How do I set ANDROID_SDK_HOME environment variable?
AndroidEclipseWindows 7SdkAdtAndroid Problem Overview
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?
Android Solutions
Solution 1 - Android
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 - Android
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 - Android
Solution 4 - Android
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 - Android
open your adt and open preferences, then modify directory with your sdk dir, it may help you follow the pic link indication
Solution 6 - Android
Just set the path to the Android SDK directory
flutter config --android-sdk c:\android\sdk
Solution 7 - Android
Android SDK
Installing the Android SDK is also necessary. The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.
Cordova requires the ANDROID_HOME
environment variable to be set. This should point to the [ANDROID_SDK_DIR]\android-sdk
directory (for example c:\android\android-sdk).
Next, update your PATH to include the tools/ and platform-tools/ folder in that folder. So, using ANDROID_HOME
, you would add both %ANDROID_HOME%\tools
and %ANDROID_HOME%\platform-tools
.
Reference : http://ionicframework.com/docs/v1/guide/installation.html
Solution 8 - Android
Although the above answers mostly get them right, there is one slight issue with them all.. Follow these steps and you are good to go
- Right click on This PC -> Properties
- On the left pane select "Advanced System Settings"
- On the new window select -> Advanced tab
- Click on the "Environment Variables" button
- On the first top section click on the "New" button
> set variable name -> ANDROID_HOME
> set variable value -> the custom location of the Android SDK
- Now click on the newly created variable name and in the box below select "Path" and click on the Edit button
- Now click on New and paste the location of the "platform-tools"
- Again click on New and paste the location of the "tools" You can find the locations of the above platform-tools and tools - they are generally inside the Android SDK folder
- MOST IMPORTANT OF ALL... > save all those by clicking ok > If you are using the terminal(cmd) close it and open it again
Solution 9 - Android
AVD cant find SDK root, possibly because they are in different directories.Set your environment variables as shown in the screenshot below:
Solution 10 - Android
from command prompt: > set ANDROID_SDK_HOME=C:\[wherever your sdk folder is]
should do the trick.
Solution 11 - Android
Just Simple Steps
Follow this steps: > > 1.Right-click on 'My Computer'/'This PC' and select Properties. Go to Advanced system settings and select ‘Environmental Variables’ option
> 2.Under the User Variable table, click New to open New User Variable dialog > > 3.Put ANDROID_HOME as Variable name and provide the path of the SDK folder next to Variable value.
> 4.Close the entire opened dialog box.
Follow this link for complete example
https://sndevelops.blogspot.com/2021/05/set-androidhome-and-path-variables.html
Solution 12 - Android
In my case, all Android Licenses were not accepted
flutter doctor --android-licenses
accept all licences and then try:
flutter build appbundle
Solution 13 - Android
If Your flutter in vscode (Mac Os) Not Want to Trouble Anything !..
- Open Extensions
- Search For "Android Emulator"
- Install "Android Emulator Launcher"
If you already installed then Uninstall it and Newly install it there !!
It Worked For me...