問題1
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.15.2 19C57, locale
zh-Hans-CN)
? Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information
解決辦法:
flutter upgrade --force
問題 2
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
? 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/setup/#android-setup for detailed instructions.
解決辦法
先執(zhí)行 flutter doctor -v
發(fā)現(xiàn)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
? Android SDK at /Users/xxx/Library/Android/sdk
? Android NDK location not configured (optional; useful for native profiling
support)
? Platform android-29, build-tools 28.0.3
? ANDROID_HOME = /usr/local/share/android-sdk
? ANDROID_SDK_ROOT = /usr/local/share/android-sdk
? Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
? Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
? 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/setup/#android-setup for detailed instructions.
然后 打開.bash_profile 文件
寫入 export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
然后 在終端 source .bash_profile
搞定