question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Requirements check failed for JDK 1.8 or greater

See original GitHub issue

I trying to publish my app but doesnt work

java version


huseyin-MacBook-Pro:city huseyinsolmaz$ 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)
huseyin-MacBook-Pro:city huseyinsolmaz$ 

ionic info ` huseyin-MacBook-Pro:city huseyinsolmaz$ ionic info

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : not installed
Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

Cordova Platforms : none
Ionic Framework   : ionic1 1.3.3

System:

Node  : v8.11.1
npm   : 5.6.0 
OS    : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145 

Environment Variables:

ANDROID_HOME : /Development/android-sdk/

Misc:

backend : pro

`

` huseyin-MacBook-Pro:city huseyinsolmaz$ sudo ionic cordova build --release android

cordova platform add android --save Using cordova-fetch for cordova-android@7.0.0

Adding android project…

Creating Cordova project for the Android platform:

Path: platforms/android
Package: io.ionic.starter
Name: city
Activity: MainActivity
Android target: android-26

Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.0.0

Android Studio project detected

Android Studio project detected

Discovered plugin “cordova-plugin-whitelist” in config.xml. Adding it to the project

Installing “cordova-plugin-whitelist” for android

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Adding cordova-plugin-whitelist to package.json Saved plugin info for “cordova-plugin-whitelist” to config.xml

Discovered plugin “cordova-plugin-device” in config.xml. Adding it to the project

Installing “cordova-plugin-device” for android

Adding cordova-plugin-device to package.json

Saved plugin info for “cordova-plugin-device” to config.xml

Discovered plugin “cordova-plugin-splashscreen” in config.xml. Adding it to the project

Installing “cordova-plugin-splashscreen” for android

Adding cordova-plugin-splashscreen to package.json

Saved plugin info for “cordova-plugin-splashscreen” to config.xml

Discovered plugin “cordova-plugin-ionic-webview” in config.xml. Adding it to the project

Installing “cordova-plugin-ionic-webview” for android

Adding cordova-plugin-ionic-webview to package.json

Saved plugin info for “cordova-plugin-ionic-webview” to config.xml

Discovered plugin “cordova-plugin-ionic-keyboard” in config.xml. Adding it to the project

Installing “cordova-plugin-ionic-keyboard” for android

Adding cordova-plugin-ionic-keyboard to package.json

Saved plugin info for “cordova-plugin-ionic-keyboard” to config.xml

Running command: /Users/huseyinsolmaz/Sites/city/hooks/after_prepare/010_add_platform_class.js /Users/huseyinsolmaz/Sites/city

–save flag or autosave detected

Saving android@~7.0.0 into config.xml file …

cordova build android --release Android Studio project detected

Running command: /Users/huseyinsolmaz/Sites/city/hooks/after_prepare/010_add_platform_class.js /Users/huseyinsolmaz/Sites/city

ANDROID_HOME=/usr/local/Caskroom/android-sdk/3859397 JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home (node:13133) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater at /Users/huseyinsolmaz/Sites/city/platforms/android/cordova/lib/check_reqs.js:370:19 at _fulfilled (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:883:30) at Promise.promise.promiseDispatch (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:816:13) at /Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:624:44 at runSingle (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:137:13) at flush (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) (node:13133) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13133) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

44reactions
Stradivariocommented, May 4, 2018

1.Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):

dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove

2.Purge config files (careful. This command removed libsgutils2-2 and virtualbox config files too):

dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge

3.Remove Java config and cache directory:

sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf

4.Remove manually installed JVMs:

sudo rm -rf /usr/lib/jvm/*

5.Remove Java entries, if there is still any, from the alternatives:

for g in ControlPanel java java_vm javaws jcontrol jexec keytool mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc xulrunner-1.9-javaplugin.so; do sudo update-alternatives --remove-all $g; done

6.Search for possible remaining Java directories:

sudo updatedb
sudo locate -b '\pack200'

7.Install JAVA-8-SDK

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get install oracle-java8-installer

8.Open sudo gedit ~/.bashrc and add these lines

export ANDROID_SDK_ROOT=/yourAndroidStudioPath/Android
export PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export JRE_HOME=/usr/lib/jvm/java-8-oracle/jre

Try to run your ionic app again 😃 Njoy!

26reactions
imhoffdcommented, Jun 12, 2018

*** IF YOU GET THIS ERROR ***

This error occurs when building Android projects for Cordova with Java 10. Cordova Android projects still require Java 8. The instructions for installing Java are different per OS.

Here are Cordova’s official instructions: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#java-development-kit-jdk

There are also plenty of online resources for installing Java 8. Just google something like "install java 8 mac os"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cordova : Requirements check failed for JDK 1.8 or greater
Open environment variables, create an environment variable called JAVA_HOME and set value to JDK install path. C:\Program Files\Java\jdk1.8.0_162 make sure you ...
Read more >
Requirements check failed for JDK 8 ('1.8.*')! Detected version ...
Issue Type​​ So I have added Android platform version 9.0. 0. Then I try to build the APK but I am getting the...
Read more >
Error: Requirements check failed for JDK 1.8 or greater - ionic-v3
I resolved this problem by moving up latest version top in PATH. Always you need to refer least version JDK in JAVA_HOME and...
Read more >
Requirements check failed for JDK 8 Detected version: 12.0.1
This error happens because of the difference between the already installed version of JDK and what Cordova required to build the App. In...
Read more >
2581598 - Cordova build Android project error, Requirements ...
2581598 - Cordova build Android project error, Requirements check failed for JDK 1.8 or greater - KAP. Symptom. In Hybrid App Toolkit setup,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found