Where Is Android_Sdk_Root and How to Set It.

how to set ANDROID_SDK_ROOT manually in windows

First of all look at your error shown:

Requirements check results for android: Java JDK: installed 14.0.2 Android SDK: not installed Failed to find 'ANDROID_SDK_ROOT' environment variable.

Cordova is still supporting Java JDK 8. So you have to uninstall other Java versions and install Java JDK 8 from here[ either Oracle Java or Open JDK]:

  1. Oracle Java - https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
  2. Open JDK 8 - https://developers.redhat.com/products/openjdk/download

After installation, set variable path like, JAVA_HOME & javac

For steps see here: https://androidabcd.info/how-to-set-java_home-in-windows-10/

You can check the java version and the javac version:

java -version
javac -version

Now you need to install Android studio to get the Android SDK. Once you get the android-sdk path, then you can set it in a variable path.

For Windows:

set ANDROID_SDK_ROOT=C:\installation location\android-sdk

set PATH=%PATH%; %ANDROID_SDK_ROOT%\tools; %ANDROID_SDK_ROOT%\platform-tools;

You can check the installation location of the sdk by opening Android Studio, on top right corner option select "SDK Manager". Then copy the sdk location.

Also, you need Gradle, and that you download Gradle binary from here and extract it in the C folder.

Set Gradle Path:

set PATH=%PATH%;C:\Gradle\gradle-7.1.1\bin;

How to solve ANDROID_SDK_ROOT=undefined (recommended setting) and ANDROID_HOME=undefined (DEPRECATED)

From the error log, it looks like either, you don't have Java installed or don't have it in your environment variable.
Ensure that <path to java>/java/<jdk version>/bin is in your environment variable. Follow this answer for adding it. https://stackoverflow.com/a/32241360/10602679

Android SDK is required to build Android apps. The recommended way to download it is through Android Studio else you need to download sdk manually

Next, you need to add the Android sdk path in your Environment variable to access the command-line utility. Follow the screenshots provided in this answer for the same. https://stackoverflow.com/a/30900424/10602679

Flutter Doctor not recognizing my ANDROID_SDK environment variables

You were using the wrong path for ANDROID_HOME

Android Studio is not necessary:

After installing flutter with snap and ensuring "/snap/bin" is in your path:

  1. sudo snap install androidsdk
  2. As regular user: androidsdk "platform-tools" "platforms;android-29" "build-tools;30.0.2"

This will install the android sdk tools you need into "$HOME/AndroidSDK"


  1. export ANDROID_HOME="$HOME/AndroidSDK"

  2. flutter doctor



Related Topics



Leave a reply



Submit