Closed nishantshah977 closed 1 week ago
JAVA_SDK error is due to Java 14 instead of Java 8.
On modern tooling, JDK 11 is the minimum required version, though JDK 17 would be recommended.
You don't have the ANDROID_HOME
environment variable defined, therefore cordova has to guess where your android SDK is installed. It's usually better if this is explicitly defined. Based on your output it looks like it's located at C:\Users\ASUS\AppData\Local\Android\Sdk
If have an opened command prompt/powershell, they will need to be re-opened after changing environment variables. Environment variables are loaded only when they are opened and will not automatically receive environment variable updates.
There is a problem with cordova docs suggesting you to install the latest command-line tools, but the latest version requires JDK 17. So you either need to use JDK 17, or use command-line tools version 10.0, and uninstall any other versions that is installed.
If you have the Android SDK Tools (Obsolete)
installed, then I'd also recommend uninstalling that. Those are the tools that only run on JDK 8 and they won't work with modern Android SDKs or run modern Android emulator images.
Thanks a lot it solved my issue.
Bug Report
Problem
Information
I'm on windows 11. JAVA_SDK error is due to Java 14 instead of Java 8.
Even though I've installed all the required sdks and configured all environment variables properly from docs. I'm still getting the error.
Command or Code
cordova run android
Environment, Platform, Device
OS: Windows
Version information
"cordova-android": "^12.0.1",
Checklist