flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Flutter Inspector is gone after 59.0.4

Open shinayser opened this issue 4 years ago • 16 comments

Just upgraded to 59.0.4 and my flutter inspector is gone from the lateral tab. Where do I find it now?

I am using Intellij Community 2021.2

image

shinayser avatar Aug 02 '21 20:08 shinayser

It seems this must be related to Skip Flutter tool windows for non-Flutter projects (WIP) (#5622).

I've tried to find a way to configure my project as a Flutter project by adding a Flutter facet but it's not available as an option.

It seems the plugin enables the Flutter windows when it determines the module is a Flutter module. This is determined by this method: https://github.com/flutter/flutter-intellij/blob/023e41ea0e73da77c33874366287f8f2b8d82c18/src/io/flutter/utils/FlutterModuleUtils.java#L74

This particular project is a multi module project, with this structure:

root_folder
	/src
		/client
			/app - flutter app
			/packages
					/package1 - flutter package
					/package2 - flutter package
			

I guess since the root_folder is not a dart/flutter module it's not detecting this project as a Flutter project.

@helin24 do you have any ideas of how to solve this or does the new tool window logic need to be reverted?

josh-burton avatar Aug 02 '21 21:08 josh-burton

I was able to work around this by going to Project settings -> Modules and manually adding my modules by using the + -> Import Module.

I think this should work out of the box though.

josh-burton avatar Aug 02 '21 21:08 josh-burton

@josh-burton that's what I was about to suggest, but I agree it would be better if we checked for these projects initially.

@shinayser are you also in a situation where your flutter project is below the top-level project that you have open?

helin24 avatar Aug 02 '21 21:08 helin24

@josh-burton that's what I was about to suggest, but I agree it would be better if we checked for these projects initially.

@shinayser are you also in a situation where your flutter project is below the top-level project that you have open?

Yes, I am using monorepo architecture. The benefits_app is the flutter module that contains the "main.dart". The other modules are simple library modules.

image

shinayser avatar Aug 02 '21 21:08 shinayser

I think another option would be to just enable dart support on the top level folder/module in project settings (I haven't tested this):

Screen Shot 2021-08-03 at 9 39 29 AM

josh-burton avatar Aug 02 '21 21:08 josh-burton

I think another option would be to just enable dart support on the top level folder/module in project settings (I haven't tested this):

Just tested this one without success.

shinayser avatar Aug 02 '21 21:08 shinayser

The Flutter plugin requires a pubspec.yaml in the top-level project directory. We have an issue to change this, but until it is addressed you are going to find various problems working with this repository structure.

stevemessick avatar Aug 02 '21 23:08 stevemessick

The Flutter plugin requires a pubspec.yaml in the top-level project directory. We have an issue to change this, but until it is addressed you are going to find various problems working with this repository structure.

The plug-in was working "ok" until this morning, when I updated to 59.0.4

shinayser avatar Aug 03 '21 00:08 shinayser

https://user-images.githubusercontent.com/15884415/127946595-54d7b2e2-e350-4c53-9b4b-d3fb9fe648c6.mp4

Facing the same issue, some projects are unable to activate the inspector window after upgraded the plugin from 58.0.4 to 59.0.4. Also no logs for IDEA were produced in the console.

AlexV525 avatar Aug 03 '21 02:08 AlexV525

The Flutter plugin requires a pubspec.yaml in the top-level project directory. We have an issue to change this, but until it is addressed you are going to find various problems working with this repository structure.

Seems like this change should be reverted until others areas of the plugin are ready for a mono repo structure.

josh-burton avatar Aug 03 '21 08:08 josh-burton

@shinayser

The plug-in was working "ok" until this morning, when I updated to 59.0.4

That statement puzzles me. If you opened a project which contains a Flutter project, none of the Flutter-specific functionality should be available. Had you done something to configure it to sort-of work? I'm sure that not everything worked, but maybe enough was available to look like it worked.

stevemessick avatar Aug 04 '21 22:08 stevemessick

@shinayser

The plug-in was working "ok" until this morning, when I updated to 59.0.4

That statement puzzles me. If you opened a project which contains a Flutter project, none of the Flutter-specific functionality should be available. Had you done something to configure it to sort-of work? I'm sure that not everything worked, but maybe enough was available to look like it worked.

I mean, the side "Flutter inspectors" bars were working fine. They were all appearing and workign as properly.

shinayser avatar Aug 04 '21 22:08 shinayser

Well, it seems you were able to use some parts of the Flutter plugin, but a number of UI features were already missing for you.

Let me rephrase my original comment. We currently only support Flutter projects that are opened as top-level projects.

I tend to agree, though, that this sort of complex project ought to be supported. I think we may need to change some plans to adapt. @devoncarew for consideration.

stevemessick avatar Aug 04 '21 22:08 stevemessick

Facing the same issue, some projects are unable to activate the inspector window after upgraded the plugin from 58.0.4 to 59.0.4. Also no logs for IDEA were produced in the console.

~~The inspector keep disappeared and can be only shown after I deleted the .idea.~~ As it turns out it was infected by the Material Theme plugin with Striped Tool Windows enabled.

AlexV525 avatar Aug 10 '21 08:08 AlexV525

I was able to work around this by adding this to the top-level project directory:

# https://github.com/flutter/flutter-intellij/issues/5694
name: dummy
publish_to: 'none'
dependencies:
  flutter:
    sdk: flutter

mono0926 avatar Oct 01 '21 23:10 mono0926

https://github.com/flutter/flutter-intellij/issues/5388 In Project Settings clicked Add Content Root

yimao009 avatar Mar 01 '22 08:03 yimao009