0

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 (cordova-lib@9.0.1)
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

Kirthi35
  • 185
  • 3
  • 16
  • https://stackoverflow.com/questions/46807676/cordova-isnt-working-with-java-9-how-to-set-a-specific-jdk-only-for-cordova refer this da – Kawinesh S K May 22 '19 at 00:12
  • Does this answer your question? [Cordova : Requirements check failed for JDK 1.8 or greater](https://stackoverflow.com/questions/40628240/cordova-requirements-check-failed-for-jdk-1-8-or-greater) – A1rPun Jan 16 '20 at 16:00

2 Answers2

0

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.

janpio
  • 10,645
  • 16
  • 64
  • 107
  • Downgrading the JDK is not easy. So I had to Install Exact version of JDK in order to Run. My only concern is security issues in JDK 1.8.*, because the Oracle has already release JDK 12.0.* – Kirthi35 May 27 '19 at 14:21
0

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

Kirthi35
  • 185
  • 3
  • 16