flutter-intellij
flutter-intellij copied to clipboard
Flutter Inspector is not available in my Android Studio workspace
I have one Dart package project, one Flutter package project and two Flutter application projects.
Folder structure:
MyWorkSpace
├── .idea
├── dart_package
├── flutter_package
├── flutter_app1
└── flutter_app2
Dependency diagram:
erDiagram
dart_package ||--o{ flutter_package : depends
dart_package ||--o{ flutter_app1 : depends
dart_package ||--o{ flutter_app2 : depends
flutter_package ||--o{ flutter_app1 : depends
flutter_package ||--o{ flutter_app2 : depends
flutter_app1
flutter_app2
Here is a minimal demo:
Each project have its own git repo. I want coding these projects in one workspace, so I use Android Studio to open MyWorkSpace folder and start debug flutter_app1, most of Flutter tools are working well, but Flutter Inspector is disabled.
Flutter plugin: 85.3.1 Dart plugin: 243.26753.1
flutter doctor:
[✓] Flutter (Channel stable, 3.32.1, on macOS 15.4 24E248 darwin-arm64, locale zh-Hans-TW)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.99.0)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
flutter --version
Flutter 3.32.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b25305a883 (8 days ago) • 2025-05-29 10:40:06 -0700
Engine • revision 1425e5e9ec (9 days ago) • 2025-05-28 14:26:27 -0700
Tools • Dart 3.8.1 • DevTools 2.45.1
Android Studio
Android Studio Meerkat Feature Drop | 2024.3.2 Patch 1
Build #AI-243.26053.27.2432.13536105, built on May 22, 2025
Runtime version: 21.0.6+-13368085-b895.109 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.4
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 14
Metal Rendering is ON
Registry:
vcs.log.index.enable=true
ide.experimental.ui=true
Non-Bundled Plugins:
Key Promoter X (2024.2.2)
Dart (243.26753.1)
com.localizely.flutter-intl (1.18.8-2024.2)
mobi.hsz.idea.gitignore (4.5.6)
io.flutter (85.3.1)
de.mariushoefler.flutter_enhancement_suite (1.7.0)
cn.yiiguxing.plugin.translate (3.7.3)
Thanks so much for the thoughtful report and repro!
@helin24: curious if you have any thoughts on this one?
Any updates? In my project, not only is the inspector unavailable, but other tools like devtools also don't work properly.
Sorry, I lost this after self-assigning. I'm not sure what's required to enable DevTools with a monorepo structure but I'll look into it.
Thank you for your work! @helin24
After some trial and error, I found that adding the following to the pubspec.yaml in the project root
dependencies:
flutter:
sdk: flutter
makes the IDE treat it as a Flutter project rather than a Dart project, which brings up the Inspector and gets DevTools working properly. So I’m wondering whether the plugin should decide whether to show the Inspector based on whether there is a Flutter project somewhere in the monorepo?
Thanks for the note! I suspect just having a pubspec helps? Have you looked at https://dart.dev/tools/pub/workspaces?
For example, the DevTools monorepo has a pubspec at the top level but does not define the flutter sdk: https://github.com/flutter/devtools
I wonder if following the example in the workspaces documentation should solve this problem, in which case I don't think we want to implement additional code in the IntelliJ plugin to handle a monorepo without a pubspec.
Thanks for the note! I suspect just having a pubspec helps? Have you looked at https://dart.dev/tools/pub/workspaces?
For example, the DevTools monorepo has a pubspec at the top level but does not define the flutter sdk: https://github.com/flutter/devtools
I wonder if following the example in the workspaces documentation should solve this problem, in which case I don't think we want to implement additional code in the IntelliJ plugin to handle a monorepo without a pubspec.
Nope, it is not enough to just create a pubspec in the root directory. You must add the flutter sdk dependency in the pubspec.
https://github.com/user-attachments/assets/2f973d35-277e-4a59-a70b-000af98889b5
I've investigated further and this is kind of complicated:
- Ideally, we would check a workspace and see if any of the subdirectories are flutter projects to decide whether to show the tool windows (I think... there may be consequences I'm not considering)
- At the moment, the inspector window is off by default (
InspectorViewFactoryshouldBeAvailablereturns false). The other windows are on by default, which is wrong (we don't want to show flutter tool windows if not in a flutter project), but unrelated to this issue. - The thing that you're doing to add flutter sdk to the project is what's needed currently to have the inspector show up. However, even if the inspector window shows up, it probably won't show any content because it can't connect to a running app.
The workaround you can try is making your subprojects modules in Android Studio. File > Project structure, then go to "modules", use the + button, make the content root the subproject with its own pubspec.yaml file. Then you should be able to see the inspector and also be able to use it when running an app.
The proper fix to check over the subdirectories needs some more investigation. I'm not sure if there's a way to do that based on the monorepo pubspec file.