Help on BUilding APK

I am struggling to build my first apk because of this error:

Android Studio project detected

ANDROID_HOME=/Users/MOfilho/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
(node:25728) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater
at /Users/MOfilho/Documents/cauculo-previdenciario/platforms/android/cordova/lib/check_reqs.js:370:19
at _fulfilled (/Users/MOfilho/Documents/cauculo-previdenciario/platforms/android/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/Users/MOfilho/Documents/cauculo-previdenciario/platforms/android/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/Users/MOfilho/Documents/cauculo-previdenciario/platforms/android/cordova/node_modules/q/q.js:816:13)
at /Users/MOfilho/Documents/cauculo-previdenciario/platforms/android/cordova/node_modules/q/q.js:624:44
at runSingle (/Users/MOfilho/Documents/cauculo-previdenciario/platforms/android/cordova/node_modules/q/q.js:137:13)
at flush (/Users/MOfilho/Documents/cauculo-previdenciario/platforms/android/cordova/node_modules/q/q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:112:11)
(node:25728) 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:25728) [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.

Can someone please help me?

Downgrade your JavaDK from 9 to 1.8:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Cordova does not understand the new versioning of java. They thought they were future proof, but did not expect new versioning:

// Let's check for at least Java 8, and keep it future proof so we can support Java 10
var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
2 Likes