(报错)Flutter Unable to locate Android SDK.
错误提示Flutter Unable to locate Android SDK[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.14393], locale zh-CN)[X] Android toolchain - develop for Android devicesX Unable to loca
·
错误提示Flutter Unable to locate Android SDK
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.14393], locale zh-CN)
[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.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
解决方案:
(1)报错提示很明显是没有找到本地的 Android sdk,因此,我们需要在电脑上配置环境变量
桌面右键 我的电脑>属性>高级系统设置>环境变量>在用户变量中新建ANDROID_HOME,变量值就是Android SDK路径
设置好之后重启电脑即可
(2)如果方案1不行的话,那么你需要通过cmd命令flutter doctor --android-licenses来执行,一直按y即可
如果你输入flutter doctor --android-licenses报错,就到flutter sdk文件夹下找到flutter_console,点击打开之后在输入flutter doctor --android-licenses
(3) 如果上述方法均无效
我建议你把你配置的Android sdk的配置给删除,然后重新添加,最后记得重启电脑(小编就是方案三得到解决的,亲测有效)
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
已为社区贡献4条内容
所有评论(0)