Flutter Doctor found issue Android_Home

心不动则不痛 提交于 2020-12-29 04:33:40

问题


I am trying to setup Flutter in windows 10. I have:

  • Android Studio installed
  • Visual Studio Code

When I run "andoid doctor" in command prompt is shows no errors:

But When I try to configure VSCode Editer with steps given in https://flutter.io/get-started/editor/

It Throws error as show below:

I tried after setting environment variable as: ANDROID_HOME = F:\Program Files\Android

Even after setting the above I get the same error.


回答1:


My device was not getting detected by VS Code so , when i searched i found you need to set Android sdk location in Flutter environment for VS code to detect Device so i went to Flutter sdk folder C:\Research\flutter and double clicked on flutter_console which opened a Flutter console and run command flutter config --android-sdk C:\Users\annur.arya\AppData\android-sdk and now it works




回答2:


I just added a solution because the solution is not clear in the comments

You have to use this command to set the ANDROID_HOME to your SDK path

export ANDROID_HOME="YOUR_SDK_PATH"

According to this discussion, some people had to set both ANDROID_HOME and ANDROID_SDK_ROOT to SDK path just like this

export ANDROID_SDK_ROOT="YOUR_SDK_PATH"
export ANDROID_HOME=$ANDROID_SDK_ROOT



回答3:


It's possible that ANDROID_HOME is not set to the same value in both of these cases; try running echo %ANDROID_HOME both in the location that works and the terminal where it doesn't. If these values are different, you'll need to figure out why (my guess would be that either you've changed it and not rebooted, or it's being set in a startup script that's only running in one of the contexts).



来源:https://stackoverflow.com/questions/49115840/flutter-doctor-found-issue-android-home

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!