flutter doctor 故障解决
C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17134.472], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 21.1.2)
X Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
To update using sdkmanager, run:
"D:\dev\android\sdk\tools\bin\sdkmanager" "platforms;android-28" "build-tools;28.0.3"
or visit https://flutter.dev/setup/#android-setup for detailed instructions.
X 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.
[√] Android Studio (version 3.2)
[!] Connected device
! No devices available
打开SDK Manager 更新一下 platforms;android-28" "build-tools;28.0.3 。更新完成,继续
C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17134.472], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
X 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.
[√] Android Studio (version 3.2)
[!] Connected device
! No devices available
Android license status unknown.
继续解决。
百度找到答案,运行下面命令。
/Users/***/Android/sdk/tools/bin/sdkmanager --update
错误提示如下:
Warning: An error occurred during installation: Failed to move away or delete existing target file: D:\dev\android\sdk\tools
Move it away manually and try again..
done
还是不行,答案在这里
https://www.jianshu.com/p/d2a0a1c39728
把sdk下面的tools文件夹,重命名一下tool或者随意,然后打开cmd,前往其目录下的bin\sdkmanager,不会去的请百度
执行--update,也就是你的X:\xxxxsdk\tool\bin\sdkmanager --update,执行
终于把tools目录搞定了。
再往下走
flutter doctor --android-licenses
一路 YES,
C:\Users\Administrator>flutter doctor --android-licenses
All SDK package licenses accepted.======] 100% Computing updates...
flutter doctor
C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17134.472], locale zh-CN)[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.2)
[!] Connected device
! No devices available! Doctor found issues in 1 category.
全部解决。
C:\Users\Administrator>flutter upgrade
Upgrading Flutter from D:\dev\flutter\sdk\flutter...
Updating d51fd86cd..b712a172f
17 files changed, 29 insertions(+), 29 deletions(-)Upgrading engine...
Flutter 1.7.8+hotfix.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b712a172f9 (8 days ago) • 2019-07-09 13:14:38 -0700
Engine • revision 54ad777fd2
Tools • Dart 2.4.0Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17134.472], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.2)
[!] Connected device
! No devices available! Doctor found issues in 1 category.