Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
CordovaError: Requirements check failed for JDK 1.8 or greater
APK Creation
ionic cordova run android
which gives me this error,
.......
ANDROID_HOME=C:\Users\dell\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk-10.0.1
(node:2172) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater
Which @ionic/app-scripts version are you using?
ionic/app-scripts : 3.1.9
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
cordova (Cordova CLI) : 8.0.0
ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
Android SDK Tools : 26.1.1
Node : v8.11.1
npm : 5.6.0
OS : Windows 10
ANDROID_HOME : C:\Usersdell\AppData\Local\Android\Sdk
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Android does not support Java 9/10. This has nothing to do with Ionic or Cordova but with the Android SDK.
Downgraded the Java version to 1.8, and I can able to build the APK now.
Thanks for the quick response @danielsogl ...!
Hi,
I have the same problem. I have dowgraded to java 8 but still same same error.
JAVA_HOME = /usr/lib/jvm/jdk1.8.0_181
@danielsogl, But how Android Studio compiles with my Java 10 if android does not support it? Do they include whole JDK ?
Having the same problem, Require 1.8. But android studio compiles correctly
Go to
/platforms/android/cordova/lib/check_reqs.js
and comment the line 370:
//throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
This should do the trick ;)
Go to
/platforms/android/cordova/lib/check_reqs.js
and comment the line 370://throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
This should do the trick ;)
@leovolpatto Your trick worked for me even with JDK 10.0.1
Go to
/platforms/android/cordova/lib/check_reqs.js
and comment the line 370://throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
This should do the trick ;)
Thank you IT worked like charm !
Most helpful comment
Go to
/platforms/android/cordova/lib/check_reqs.js
and comment the line 370:
//throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
This should do the trick ;)