Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.3.1 20E241 darwin-arm, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio
✗ Unable to find bundled Java version.
[✓] VS Code (version 1.58.2)
[✓] Connected device (1 available)
解决办法:
第一步在这个文件里flutter/packages/flutter_tools/lib/src/android/android_studio.dart
把globals.fs.path.join(directory, 'jre', 'jdk', 'Contents', 'Home') :替换成globals.fs.path.join(directory, 'jre', 'Contents', 'Home') ,就是去掉jdk。
然后在android studio preview.app的包中把/Applications/Android Studio Preview.app/Contents/jre/Contents中的文件copy到/Applications/Android Studio Preview.app/Contents/jre/jdk/Contents中。
网友评论