Can't run Flutter project if it's within a Bazel directory
See original GitHub issueI have a Flutter project that’s within a Bazel directory. It’s not built by Bazel in any way, but it happens to be in a monorepo that uses Bazel for most other things.
Running and debugging from within Android Studio used to work fine, but is now broken. Trying to launch main.dart
results in an error:
Entrypoint isn’t within a Flutter pub root.
Looking at Preferences > Languages & Frameworks > Flutter shows that the Flutter SDK path has changed to /Users/rohan/tidbyt/null <set by bazel project>
. That isn’t a valid path on my machine. Resetting the setting here doesn’t seem to do anything.
I have a hunch that this is related to #4735 (/cc @helin24 @jacob314). My guess is that that broke the IntelliJ plugin for Flutter projects in Bazel directories outside of Google.
Steps to Reproduce
- Have a Flutter project that’s inside a Bazel workspace. (not at Google)
- Try to run the project from within Android Studio
Version info
[✓] Flutter (Channel unknown, 1.20.2, on Mac OS X 10.15.6 19G2021, locale en-US)
• Flutter version 1.20.2 at /opt/flutter
• Framework revision bbfbf1770c (5 weeks ago), 2020-08-13 08:33:09 -0700
• Engine revision 9d5b21729f
• Dart version 2.9.1
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/rohan/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
✗ Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 49.0.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.49.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.1
[✓] Connected device (3 available)
• Pixel 3 (mobile) • 8BWX1G3QH • android-arm64 • Android 11 (API 30)
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 85.0.4183.102
! Doctor found issues in 1 category.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (7 by maintainers)
Top GitHub Comments
@helin24 Yup, that’s exactly how my project is setup.
Thanks for checking; it’s likely there is an issue with our bazel check, so we’ll look into it.
Last thing, can you send along your log? Help -> show log in finder