Reputation: 51
I am trying to build an apk for Android. when I run the command ionic cordova build android
I get the error:
Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=C:\Users\myUserName\AppData\Local\Android\Sdk (recommended setting) ANDROID_HOME=C:\Users\myUserName\AppData\Local\Android\Sdk (DEPRECATED) Requirements check failed for JDK 1.8.x! Detected version: 17.0.1 Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.
App · Command "cordova" failed with exit code: 1 App · Updated Cordova config.xml App · ⚠️ [FAIL] Cordova CLI has failed
It says I need JDK 1.8.x, but it detected But I am pretty sure I have JDK 1.8 installed
my JAVA_HOME environment variable is set to C:\Program Files\Java\jdk-17.0.1
I have no idea why I can't get the app to build. Please help!
Upvotes: 1
Views: 3886
Reputation: 11
You need to change your JAVA_HOME entry and put there path to JDK 1.8 installation.
Upvotes: 1