FLUTTER DOCTOR [X] Android 工具链
Posted
技术标签:
【中文标题】FLUTTER DOCTOR [X] Android 工具链【英文标题】:FLUTTER DOCTOR [X] Android toolchain 【发布时间】:2021-08-28 23:54:12 【问题描述】:大家好,当我在控制台“Flutter doctor”上输入之前,我遇到了 android-SDK 的问题:
[√] Flutter (Channel stable, 2.2.1, on Microsoft Windows [Version 10.0.18363.1500],
locale pl-PL)
[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.
[√] Chrome - develop for the web
[√] Android Studio
[√] Connected device (1 available)
我检查了平台工具,我认为我拥有安装所需的一切
我的平台工具屏幕
enter image description here
enter image description here
我的 SDK 文件夹 enter image description here
【问题讨论】:
【参考方案1】:X 无法找到 Android SDK。
在“Windows 10的环境变量”中添加Android SDK的位置
https://programsbuzz.com/article/how-set-android-environment-variable-path-windows-10
【讨论】:
是的,它就是这样工作的!我必须添加 path\\platform-tools 和 path\\platforms【参考方案2】:尝试运行这个命令,它对我有用。我希望这对你也有用。
flutter doctor --android-licenses
【讨论】:
当我这样做时,我得到:“无法找到 Android SDK”以上是关于FLUTTER DOCTOR [X] Android 工具链的主要内容,如果未能解决你的问题,请参考以下文章
Flutterflutter doctor 报错Android license status unknown. Run `flutter doctor --android-licenses‘(代码片段
运行 Flutter Doctor 时出现 Flutter android 许可错误