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]:
- Oracle Java - https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
- 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:
- sudo snap install androidsdk
- 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"
export ANDROID_HOME="$HOME/AndroidSDK"
flutter doctor
Related Topics
How to Get Context in Android Mvvm Viewmodel
Android: Keep Service Running When App Is Killed
Sending Files Using Post With Httpurlconnection
Java.Io.Filenotfoundexception Open Failed Eacces (Permission Denied) on Device
Remove Old and Add New Git in Android Studio
How to Change the Default Height of a Bottomsheetdialog
Apk Signing Error:Failed to Read Key from Keystore
Android Studio 0.4.3 - Task 'Assemble' Not Found in Root Project
Eclipse Compiles Successfully But Still Gives Semantic Errors
Best Practice For Instantiating a New Android Fragment
Update Some Specific Field of an Entity in Android Room
Android Adb Doesn't See Device
React-Native: Images Not Showing in Android Device; But Shows in Emulator
Gradle Error: Could Not Execute Build Using Gradle Distribution
React-Native: Module Appregistry Is Not a Registered Callable Module