How do I set ANDROID_SDK_HOME environment variable?
Solution 1
ANDROID_HOME
Installation directory of Android SDK package.
Example: C:\AndroidSDK
or /usr/local/android-sdk/
ANDROID_USER_HOME
Location of SDK related data/user files.
Example: C:\Users\<USERNAME>\.android\
or ~/.android/
ANDROID_SDK_ROOT
Deprecated (in Android Studio), use ANDROID_HOME
instead.
ANDROID_NDK_ROOT
Installation directory of Android NDK package. (WITHOUT ANY SPACE)
Example: C:\AndroidNDK
or /usr/local/android-ndk/
ANDROID_SDK_HOME
Deprecated (in Android Studio 4.2), use ANDROID_PREFS_ROOT
instead.
ANDROID_PREFS_ROOT
Deprecated (in Android Studio), use path to subdirectory .android
via ANDROID_USER_HOME
instead.
Example: C:\Users\<USERNAME>\
or ~/
ANDROID_EMULATOR_HOME
Location of emulator-specific data files.
Example: C:\Users\<USERNAME>\.android\
or ~/.android/
ANDROID_AVD_HOME
Location of AVD-specific data files.
Example: C:\Users\<USERNAME>\.android\avd\
or ~/.android/avd/
JDK_HOME
and JAVA_HOME
Installation directory of JDK (aka Java SDK) package.
Note: This is used to run Android Studio(and other Java-based applications). Actually when you run Android Studio, it checks for JDK_HOME
then JAVA_HOME
environment variables to use.
Solution 2
If you face the same error, here are the step by step instructions:
- Open control panel
- Then go to System
- Then go to Change Environment Variables of the User
- Then click create a new environment variables
- Create a new variable named ANDROID_SDK_HOME
- Set its value to your Android directory, like
C:/users/<username>/.android
Solution 3
Copy your SDK path and assign it to the environment variable ANDROID_SDK_ROOT
Refer pic below:
Solution 4
This worked for me:
- Open control panel
- click System
- Then go to Change Environment Variables
- Then click create a new environment variables
- Create a new variable named ANDROID_HOME path C:\Android\sdk
Solution 5
open your adt and open preferences, then modify directory with your sdk dir, it may help you follow the pic link indication
Comments
-
OlegArsyonov over 2 years
I'm working with Eclipse on Windows 7, x64. I'm getting an error when running ADT bundle of android development:
Error: Error parsing the AVDs
Unable to get the Android SDK home directory.
Make sure the environment variable ANDROID_SDK_HOME is set up.I know what the issue is. Is it because it is linked to a wrong directory C:users:????
How do I set this environment variable android_sdk_home to the proper directory?
-
OlegArsyonov about 10 yearsI need ANDROID_SDK_HOME variable to set. SDK dir is nice and set..... How do I SET ANDROID_SDK_HOME variable? What that variable is? Where is it?
-
jww over 9 yearsIf this is the answer, then you should accept your own answer. That's how Stack Overflow works. See How does accepting an answer work?.
-
jww over 9 yearsThis does not look quite right:
C:/users/<username>/.android
. That looks like theANDROID_HOME
directory, and not the SDK directory. The SDK directory would beANDROID_SDK_ROOT
. Here's the reference onANDROID_SDK_ROOT
andANDROID_NDK_ROOT
: Recommended NDK Directory?. The fellow named Digit works on the NDK team. -
Camilo Martin over 9 yearsPlease upload images through this site's interface (they get hosted on imgur).
-
Frank almost 8 years@jww - did you read the thread you linked? It never even references
ANDROID_HOME
. It only refers to 3 variables as 'standard.' In addition, it specifiesANDROID_SDK_HOME
as equaling~/.android/
on Linux, which corresponds to%USERPROFILE%\.android
on Windows. The fact is that, you don't need to specify the.android
subfolder. On Windows, you just setANDROID_SDK_HOME
to whatever folder it resides in. So, in the OP's case, it would be set toC:\Users\<username>
or%UserProfile%
and for others, wherever you like. The only caveat is that the (parent) folder must exist. -
jww almost 8 years@Frank - yes, I read it (it was my question to the NDK folks).
ANDROID_SDK_ROOT
is the one variable I am aware of that Android uses to determine the SDK location. Who knows whatANDROID_SDK_HOME
is. Eclipse does not document it, and its not obvious to me why yet another variable is needed. My best guess is you should setANDROID_SDK_HOME
toANDROID_SDK_ROOT
. -
Kartiikeya almost 8 yearsWhether the location should be in C drive ?
-
Yousha Aleayoub over 7 years@Kartiikeya, No, anywhere. But given path shouldnt contain
space
. -
Snappy Cracker over 6 yearsANDROID_HOME will work if the path is correct. If the path is incorrect or is unable to find ANDROID_HOME it will look for ANDROID_SDK_HOME. That is why it works if you have either set correctly.
-
Snappy Cracker over 6 yearsREAD before commenting for the love of Martha. Several comments above tell you how to find the location of your particular SDK location. set ANDROID_SDK_HOME=C:[wherever your sdk folder is] and that is explained above, look just above at the large image.
-
Yousha Aleayoub over 6 years
ANDROID_HOME
is DEPRECATED, setANDROID_SDK_ROOT
instead. -
Joshua Pinter about 6 yearsI had a difficult time getting Android Studio respecting these environment variables. I would set the
ANDROID_SDK_HOME
but Android Studio would still want to create AVDs in the~/.android/avd
directory. Any idea what could be the issue? I ended up using a symlink from~/.android
to my desired directory. -
binary over 5 years@JoshuaPinter I had same issue, somehow Android Studio is not honoring any of these environment variables, at last symlink worked well.
-
Earlee about 5 years@YoushaAleayoub
ANDROID_SDK_ROOT
orANDROID_SDK_HOME
? -
Zack over 4 yearsCreated a symbolic link using
ln -s $ANDROID_SDK_HOME ~/.android
-
Vigs about 4 yearsWorked for me! Also great to read up here: developer.android.com/studio/command-line/…
-
Zoe Marmara about 4 yearsI was missing the 'JDK_HOME' system variable. Thanks! 🙏🙏🙏
-
George almost 4 yearsOP should set this as selected answer.
-
9 Guy about 3 yearsOn windows look in AppData\Local\Android\
-
4b0 almost 3 yearsSnehal wadbudhe, a link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it is there, then quote the most relevant part of the page you are linking to in case the target page is unavailable. Answers that are little more than a link may be deleted.
-
Ola Ström over 2 yearsAnother way to open the Advanced Properties is by using the Win+R keyboard shortcut and typing the command "sysdm.cpl ,3".
-
Ola Ström over 2 yearsBut I guess you should use ANDROID_SDK_ROOT instead of ANDROID_HOME, see below answers.