flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 318 forks source link

Flutter Inspector Widgets Tab is empty #2205

Closed kunli0 closed 6 years ago

kunli0 commented 6 years ago

Steps to Reproduce

Turn on the "Run application with --track-widget-creation" which I assume will bold items in the inspector and allow double clicking to automatically highlight the code where the widget was created. Upon doing so however, the Widgets tree becomes completely empty, not showing anything.

Version info

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, v0.3.1, on Microsoft Windows [Version 6.1.7601], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK 27.0.3) [√] Android Studio (version 3.1) [√] Connected devices (1 available)

Android Studio 3.1.2 Build #AI-173.4720617, built on April 13, 2018 JRE: 1.8.0_152-release-1024-b02 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 7 6.1

Android Studio Flutter Plugin: Version: 24.0.1

devoncarew commented 6 years ago

I believe this is a dup of https://github.com/flutter/flutter-intellij/issues/2029; can you try updating to the latest plugin version (just released) and see if it address the issue?

devoncarew commented 6 years ago

If no, please re-open (/cc @jacob314).

kunli0 commented 6 years ago

Using Plugin Version: 24.0.1

devoncarew commented 6 years ago

The latest is 24.1.x -

kunli0 commented 6 years ago

Just updated Flutter Plugin to 24.1 and restarted Android Studio however widgets inspection still empty with "Run application with --track-widget-creation" enabled.

jacob314 commented 6 years ago

Can you try manually deleting your build directory and re-running to test whether that works around the issue?

kunli0 commented 6 years ago

Manually deleted build directory. Build directory was recreated however, same issue. This is what the Inspector looks like.

image

devoncarew commented 6 years ago

Hmm, the inspector is connected, just no widget info is showing. Do the render tree or performance tabs show anything? Are there any errors in the Android Studio logs?

kunli0 commented 6 years ago

The render tree and performance tabs both work fine.

kunli0 commented 6 years ago

This is the only thing that looks of interests

2018-05-04 14:41:48,293 [J pool 0/7] WARN - eInsight.daemon.LineMarkerInfo - Performance warning: LineMarker is supposed to be registered for leaf elements only, but got: FUNCTION_DECLARATION_WITH_BODY_OR_NATIVE (class com.jetbrains.lang.dart.psi.impl.DartFunctionDeclarationWithBodyOrNativeImpl) instead. First child: RETURN_TYPE (class com.jetbrains.lang.dart.psi.impl.DartReturnTypeImpl) Please see LineMarkerProvider#getLineMarkerInfo(PsiElement) javadoc for detailed explanations.

jacob314 commented 6 years ago

Is it just for this project or for all projects? I expect what is happening is we are failing to detect that any widgets were created by the local project. If you can provide a repro git repro I can test on that would be extremely helpful.

kunli0 commented 6 years ago

I just created the default "New Flutter Project" and it is still blank in the inspector. The other project was the same thing, with the code in main.dart replaced with This

kunli0 commented 6 years ago

I thought it may have been the machine that I was on which was at work. Now at home following the same process, getting the same results on the Flutter Inspector from the default "New Flutter Project"

jacob314 commented 6 years ago

I'm able to repro on windows. This was an issue with how we are handling file paths. Sending out a fix.

jacob314 commented 6 years ago

The fix has landed and I'll add a comment to this bug when we publish a new version of the plugin with the fix.

jacob314 commented 6 years ago

The fix is available in the just released M24.2 build. Please let me know if the issue is now fixed for you.

kunli0 commented 6 years ago

Working as intended. Thanks!

cfkloss commented 6 years ago

Still not working for me after 24.2 with AS 3.1 and Idea 2018.1.4 (CE)

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, v0.4.4, on Microsoft Windows [Version 10.0.16299.371], locale pt-BR) [√] Android toolchain - develop for Android devices (Android SDK 27.0.3) [√] Android Studio (version 3.1) [√] Android Studio (version 3.2) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. [√] IntelliJ IDEA Community Edition (version 2018.1.old) [√] Connected devices (1 available)

• No issues found!

jacob314 commented 6 years ago

@cfkloss can you provide some more details of what you are seeing?

  1. What is the full path to your flutter application? e.g. "c:/foo/bar/my_flutter_app"
  2. Can you include a screenshot showing what the inspector window looks like?
  3. Did any internal IDE errors occur? You can check by clicking on the icon in the bottom right corner of the IDE: image
  4. Does the "Render Tree" tab in the inspector work for you or is it broken as well?
cfkloss commented 6 years ago

@jacob314 I've found the problem.

My projects are all inside a symbolic link folder. The original location is at "d:\Insync\Projects" and the symbolic link is at "c:\Projects\". If I open it at the original location it works as intended but it does not work when it is opened from the symbolic link folder.

  1. The full path to the application is "c:\Projects\Testes\teste\"
  2. screenshot included
  3. No internal IDE error
  4. Yes, the render tree works.

Now that i found the problem I can work around it by opening the original location. But it would be great if it could work from inside a symbolic link folder also.

flutter issue 2205
nicodeslandes commented 4 years ago

Having the same problem with the latest version. Exactly the same setup as @cfkloss , my "C:\Projects" is a symbolic link. Opening the original location fixes the problem, but I'd rather not have to do that.

devoncarew commented 4 years ago

cc @jacob314 as it looks like symbolic links can confuse the inspector

Hesamedin commented 2 years ago

The issue is still happening. I am using the latest version of the Android Studio, Dart, and Fluter SDKs. What I can say is that I usually don't close my IDE at night (when I don't work). Then the next day, I continue my work. In this particular case, I closed the IDE, restarted it, and then launched my emulator. I was able to see the tree in the Flutter Inspector tab.