我曾尝试在我的计算机上卸载并重新安装 Flutter 两次,但无论何时运行 flutter doctor
在终端中,我仍然遇到以下错误。
[✗] 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/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
有谁知道如何解决这个问题?另外,这可能是我的模拟器都没有运行我的应用程序的原因吗?谢谢,对不起,我还是 Flutter 和 android studio 的新手。
最佳答案
如果它无法找到您的 Android SDK,原因可能是您的 Android SDK 路径不是最新的。
我认为您的问题与此类似:https://github.com/flutter/flutter/issues/45007 .
试试 flutter config --android-sdk <path-to-your-android-sdk-path>
更新 Android SDK 路径。
关于android - 无法为 flutter 医生找到 android SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62503437/