flutter doctor 报错 Unable to locate Android SDK.

安装flutter后报错,出现这个问题,是因为你的C盘 也就是系统盘找不到Android SDK
[✓] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.19042.804], locale zh-CN)
[✗] Android toolchain - develop for Android devices
✗ 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/setup/#android-setup for detailed instructions).
If the 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.
[!] Android Studio (not installed)
[✓] VS Code (version 1.34.0)
[✓] Connected device (1 available)

解决办法 :配置环境变量,在用户变量中添加 ANDROID_HOME或者ANDROID_SDK_ROOT 然后再后面填写你的SDK路径运行就行
如图所示


image.png

你可能感兴趣的:(flutter doctor 报错 Unable to locate Android SDK.)