Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable

痴心易碎 提交于 2019-11-27 18:20:07

问题


"Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable."

Facing this issue while building the Cordova Project through Terminal, if I run through Android Studio I am not getting the issue what will be the root cause for this issue.


回答1:


This is just a workaround while cordova is being updated:

  1. Remove directory /Android/sdk/tools
  2. download https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
  3. Unzip
  4. Place new folder in /Android/sdk/tools



回答2:


If nothing was worked, try

cordova platform remove android

and

cordova platform add android

in your Cordova project

edit

Solution 2

Remove cordova

npm uninstall cordova -g

Add cordova

npm install -g cordova

Remove Android platform from project

cordova platform remove android

Add Android platform again

cordova platform add android



回答3:


You need to set Android home variable through command line. Try these commands to set Android_Home variable.

export ANDROID_HOME=~/Android/Android/Sdk

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

PS: Replace ~/Android/Android/Sdk with your Android SDK path.




回答4:


Just set the ANDROID_HOME environment variable.give the path to the android sdk installed.



来源:https://stackoverflow.com/questions/42950169/android-sdk-not-found-make-sure-that-it-is-installed-if-it-is-not-at-the-defau

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