1
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 。更新完成,继续
2
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
百度找到答案,运行下面命令。
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,
3
Error running Gradle: ProcessException: Process "C:\Users\Downloads\fluttermusic\android\gradlew.bat" exited abnormally:
Configure project :app
IOException: https://dl.google.com/android/repository/addons_list-3.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-2.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-1.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
Failed to download any source lists!
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\F2846804\Downloads\fluttermusic\android\build.gradle' line: 32
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Failed to find Build Tools revision 28.0.3
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
Command: C:\Users\Downloads\fluttermusic\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
解决方法:
您可以尝试清除代理设置,找到如下文件(您电脑里的用户名可能不同):
C:\Users\Administrator.gradle\gradle.properties
右键点击,选择一个文本编辑器打开它,找到跟代理设置相关的行,注释或者删除。