美文网首页
执行 flutter doctor 出错的解决办法

执行 flutter doctor 出错的解决办法

作者: MrAlexLee | 来源:发表于2020-01-27 00:51 被阅读0次

问题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.

解决办法

先执行 flutter doctor -v
发现
[!] 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
搞定

相关文章

网友评论

      本文标题:执行 flutter doctor 出错的解决办法

      本文链接:https://www.haomeiwen.com/subject/lgpsthtx.html