Kirthi35
Kirthi35

Reputation: 185

Cordova build android Failed !!! Requirements check failed for JDK 8 ('1.8.*')! Detected version: 9.0.1 In Windows 10

My machine runs on Windows 10 64bit OS. I have properly configured the path for JAVA and Andoird, When I run "Cordova requirements" it runs without any error. After that, If I try to run Corodva build I am getting the below-mentioned error

Running command: node c:\workspace\myapp\hooks\after_prepare\010_add_platform_class.js c:\workspace\myapp

Checking Java JDK and Android SDK versions

ANDROID_SDK_ROOT=C:\Users\Admin\AppData\Local\Android\Sdk (recommended setting)

ANDROID_HOME=C:\Users\Admin\AppData\Local\Android\Sdk (DEPRECATED)

Requirements check failed for JDK 8 ('1.8.*')! Detected version: 9.0.1

Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.

$ ionic info

Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\Admin\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic1 1.3.4
@ionic/v1-toolkit : 1.0.22

Cordova:

cordova (Cordova CLI) : 9.0.0 ([email protected])
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.4.1, (and 5 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Users\Admin\AppData\Local\Android\Sdk)
NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10

$ cordova requirements

Requirements check results for android:

Java JDK: installed 9.0.1

Android SDK: installed true

Android target: installed android-28,android-27,android-26,android-25,android-24,android-23,android-22,android-21,android-19,android-18,android-17,android-16

Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-5.1.1\bin\gradle

Upvotes: 0

Views: 3672

Answers (2)

Kirthi35
Kirthi35

Reputation: 185

I had to install the exact version of JDK 1.8 to resolve the issue.

Upvotes: 0

janpio
janpio

Reputation: 10912

You have Java 9.0.1 installed:

Java JDK: installed 9.0.1
...
Detected version: 9.0.1

It tells you that it needs JDK 8 (also known as 1.8):

Requirements check failed for JDK 8 ('1.8.*')!

So your solution obviously is to install JDK 8 instead of 9.

Upvotes: 0

Related Questions