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

Error after opening IDE

Open fabiancrx opened this issue 3 years ago • 3 comments

What happened

Nothing visible , opened the project and the IDE error was reported. If its not important feel free to close this issue as I did not noticed any issue (other than the IDE reporting an error)

Version information

IntelliJ IDEA 2022.2 • Flutter plugin io.flutter 69.0.5 • Dart plugin 222.3345.108

Flutter 3.0.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision f1875d570e (3 weeks ago) • 2022-07-13 11:24:16 -0700 Engine • revision e85ea0e79c Tools • Dart 2.17.6 • DevTools 2.12.2

Exception

null

java.util.concurrent.CompletionException: java.lang.RuntimeException: WidgetInspectorService class not found
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.RuntimeException: WidgetInspectorService class not found
	at io.flutter.inspector.InspectorService.lambda$create$3(InspectorService.java:235)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
	... 6 more
Flutter doctor

[✓] Flutter (Channel stable, 3.0.5, on Fedora Linux 36 (Workstation Edition) 5.18.13-200.fc36.x86_64, locale en_US.UTF-8) • Flutter version 3.0.5 at /home/croxx/fvm/versions/stable • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (3 weeks ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /home/croxx/dev/androidSDK • Platform android-32, build-tools 30.0.3 • ANDROID_HOME = /home/croxx/dev/androidSDK • Java binary at: /home/croxx/Applications/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

[✗] Chrome - develop for the web (Cannot find Chrome executable at /usr/bin/microsoft-edge) ! /usr/bin/microsoft-edge is not executable.

[✓] Linux toolchain - develop for Linux desktop • clang version 14.0.0 (Fedora 14.0.0-1.fc36) • cmake version 3.22.2 • ninja version 1.10.2 • pkg-config version 1.8.0

[✓] Android Studio (version 2021.2) • Android Studio at /home/croxx/Applications/android-studio • Flutter plugin version 69.0.2 • Dart plugin version 212.5744 • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3) • IntelliJ at /home/croxx/Applications/idea-IU-2021.3 • Flutter plugin version 63.2.4 • Dart plugin version 213.5744.122

[✓] IntelliJ IDEA Ultimate Edition (version 2022.2) • IntelliJ at /home/croxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.3345.118 • Flutter plugin version 69.0.5 • Dart plugin version 222.3345.108

[✓] VS Code (version 1.69.2) • VS Code at /usr/share/code • Flutter extension version 3.44.0

[✓] Connected device (2 available) • SM S901U (mobile) • R5CT524NHCY • android-arm64 • Android 12 (API 31) • Linux (desktop) • linux • linux-x64 • Fedora Linux 36 (Workstation Edition) 5.18.13-200.fc36.x86_64

[✓] HTTP Host Availability • All required HTTP hosts are available

! Doctor found issues in 2 categories.

fabiancrx avatar Aug 02 '22 20:08 fabiancrx

I think that code should not be throwing an exception. It is trying to resolve "package:flutter/src/widgets/widget_inspector.dart" and not finding it. That may be due to the Flutter SDK not being set, or some other configuration issue. Perhaps you changed the location of the Flutter SDK on disk before opening the project? If you're curious you can see if the problem is likely to re-occur. In your Flutter project, at the bottom of the Project tool window, expand External Libraries. There should be a library named Dart Packages. Expand that and look for flutter/src/widgets/widget_inspector.dart.

If everything looks OK and the problem happens anyway, then something very odd is happening.

stevemessick avatar Aug 02 '22 22:08 stevemessick

No SDK location changed, I was able to navigate to the widget_inspector.dart following your instructions and, the error seemed to be erratic as I was not able to reproduce it (mainly opening and closing Intellij several times 😅).

fabiancrx avatar Aug 03 '22 00:08 fabiancrx

Thanks for the update. This is a puzzle, but I don't know how it can happen, so I'll leave this open for now.

stevemessick avatar Aug 03 '22 17:08 stevemessick