本文介绍: [X] Android toolchain – develop for Android devices X Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components.
jcLee95:https://blog.csdn.net/qq_28550263
https://blog.csdn.net/qq_28550263/article/details/132869987
Flutter 诊断常见问题
问题1:
问题描述
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
原因分析
这个错误表示找不到Android SDK。可能的原因是Android Studio没有安装或者安装路径没有正确配置。
解决办法
PS > flutter config --android-sdk D:AndroidSDK
Setting "android-sdk" value to "D:AndroidSDK".
You may need to restart any open editors for them to read new settings.
问题2:
问题描述
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
原因与解决
这个错误信息表明 Flutter 环境缺少必要的Android工具链和SDK许可证。以下是针对每个错误的解决。
1. 错误信息:cmdline–tools组件缺失
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
- 打开终端并运行上述命令,将
path/to/sdkmanager
替换为你的Android SDK的路径。这个命令会安装最新的cmdline–tools组件。示例:/path/to/android/sdk/tools/bin/sdkmanager --install "cmdline-tools;latest"
- 如果你不知道Android SDK的确切路径,可以使用
flutter config
命令来查找它。运行以下命令:flutter config --android-sdk
例如:
flutter config --android-sdk D:Androidandroid-sdk
2. 错误信息:Android许可证状态未知
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
解决方法:
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
7 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)? Y
完成上述步骤后,你的Flutter环境应该能够正常运行,并且不再显示这些错误信息。如果你遇到其他问题,请检查Flutter和Android SDK的安装,并确保它们都正确配置。
问题3:
问题描述
[!] Network resources
✗ An HTTP error occurred while checking "https://github.com/": 信号灯超时时间已到
这个错误信息表明在尝试检查GitHub上的资源时发生了HTTP错误,并且错误信息中提到”信号灯超时时间已到”。这通常是由于网络问题或GitHub服务器不可访问引起的。以下是一些可能的解决方法:
-
检查GitHub状态:
原文地址:https://blog.csdn.net/qq_28550263/article/details/132869987
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_8799.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。