I'm trying to install PhoneGap and I'm getting the following error:
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
Error (screenshot)
What do I do to ensure Android is set up correctly for use with Cordova?
1: go to system properties
2: click change setting
3: click advance tab
4: click Environment Variables... button
5: in system variables area click new button
6: set ANDROID_HOME in the Variable name field
7: set C:\Program Files (x86)\Android\android-sdk in the Variable value field
9: click ok button
10: double click Path variable in the list
11: click new button
12: past C:\Program Files (x86)\Android\android-sdk\platform-tools in the filed
13: click new button again
14: past C:\Program Files (x86)\Android\android-sdk\tools in the field
15: press enter 3 times.
your are good to go.
For Windows:
Taken from this installation guide.
Using Android Studio on Windows the system variables settings have changed a little.
You still have to add a system variable
ANDROID_HOME
, but pointing to the directory containing the android SDK usually installed inC:\Users\YOUR_USERNAME\AppData\Local\Android\android-studio\sdk
.You also need to add the following to the
Path
system variable:;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;
Taken from: https://github.com/simnova/webdevdocs/wiki/Installing-PhoneGap-and-Android-Studio-on-Windows
SDK Path also be in
C:\Users\USER\AppData\Local\Android\sdk
For Windows I just had to add an env variable pointing to the SDK folder. Done! (The accepted answer didn´t work for me)
Using Android Studio on Mac, run this on your terminal:
Then, when you type
at your terminal, it will run something
In Linux,
edit
.bashrc
file and add theANDROID_HOME
andPATH
variable,After saving
.bashrc
file, runthen in type
android
in a terminalif it will run,
ANDROID_HOME
andPATH
is set,if you get this message,
then run
otherwise you will get same error message
NB: Use your android sdk installation path instead of /usr/local/android-sdk-linux/