Closed AdrienV closed 6 years ago
Your issue seems to be related to your dev environment. As explained on the Ionic documentation, the requirements for deploying to android devices are to install the following in your computer:
Please make sure you have the Java JDK installed as the error seems to be related to that.
Personally I have the following versions installed on my mac
$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
Hi @djabif,
JAVA was installed, but an old version. What I did to try with a clean config :
ANDROID_HOME=/Users/adrienv/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home (node:9166) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater at /Users/adrienv/NoiCloud/example/ionicthemes2/platforms/android/cordova/lib/check_reqs.js:378:19 at _fulfilled (/Users/adrienv/NoiCloud/example/ionicthemes2/platforms/android/cordova/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/Users/adrienv/NoiCloud/example/ionicthemes2/platforms/android/cordova/node_modules/q/q.js:883:30) at Promise.promise.promiseDispatch (/Users/adrienv/NoiCloud/example/ionicthemes2/platforms/android/cordova/node_modules/q/q.js:816:13) at /Users/adrienv/NoiCloud/example/ionicthemes2/platforms/android/cordova/node_modules/q/q.js:624:44 at runSingle (/Users/adrienv/NoiCloud/example/ionicthemes2/platforms/android/cordova/node_modules/q/q.js:137:13) at flush (/Users/adrienv/NoiCloud/example/ionicthemes2/platforms/android/cordova/node_modules/q/q.js:125:13) at process._tickCallback (internal/process/next_tick.js:112:11) (node:9166) 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:9166) [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. [OK] Your app has been deployed.
I try since 5 days, I really tried many different things found on Internet... I tried to uninstall / resintall everything (Java / Android Studio / Change SDK / Change Gradle / Change JDK version......), and I continue to get any different errors. I begin to think to just format my OS... I don't know how it's possible that a clean project cannot build with Android on my computer...
Sometime when I try to build my system get different cordova-android version, I don't know why, in the same project, without reason... :(
ionic cordova run android --device
cordova platform add android --save
Using cordova-fetch for cordova-android@6.3.0
It can be :
cordova-android@7.0.0
or
cordova-android@6.3.0
or
cordova-android@5.1.1
I don't know how it's choosed....
Could you tell me wich versions you are using to build your Elite project please ? JDK Version : 1.8.0_25 Android SDK : ? Cordova-android : ?
Thanks again.
The cordova-android version used by the project is set on config.xml file You don't need to format your computer! It's just a matter of configurations. Don't panic ;)
Please also check this thread https://forum.ionicframework.com/t/error-requirements-check-failed-for-jdk-1-8-or-greater/68734/2 and try to install java jdk 8 as it is suggested there.
I'm using the following versions: java version "1.8.0_25" Cordova-android: 6.3.0 Android SDK: 27
Whouuuu !!! Just a BIG THANKS !!! You save me.
For me it’s finally solved. But really… It’s complicated to say what I really did since 5 days. I will try to explain the last step to get it works, if it can help others… :)
I had 2 SDK installed (V27 et V2) -> I deleted the 27 and install the 26
I deleted JAVA 10 completely and reinstal JAVA 8 (JDK 1.8 rev 171)
Created a new folder with the sources of this theme
npm install
ionic cordova platform add android@6.3.0 OR
don’t forget to put this line in your config.xml : <engine name="android" spec="6.3.0" />
ionic cordova run android —device
An error occured for me : Error: spawn EACCES
To solve it :
sudo chmod 777 “/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle” — BE CAREFUL to the gradle version is yours —
After that, run again :
IN MY CASE, it works… But after 5 days I really try many things and I don’t know what I really did to solve it. Maybe this save me :
<engine name="android" spec="6.3.0" />
Maybe try to be sure to use : Java JDK 1.8 Android Studio + SDK 26 Gradle 4.1
And be sure you run android with this version « @6.3.0 » (for me I got many errors with version 7.0.0).
I'm glad you solved it! Local configs can be tricky sometimes but we can not give up!
Hi,
I have an issue with my configuration and the temlpate ion2fullapp.
Everything work good with iOs, the app is deployed, but with Android I have many problems. Since 4/5 days I try many many different things but it blocks at some different points. I think the configuration of my Mac is not good, something block maybe the version of the SDK, the version of the gradle… I don’t know, but if you can help me to resolve this it could be very helpful.
I just created a clean project, to try with your base package :
---------------------------------- TERMINAL ----------------------------------
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
--save flag or autosave detected
Saving android@~6.3.0 into config.xml file ...
Running app-scripts build: --platform android --target cordova [20:26:22] build dev started ... [20:26:22] clean started ... [20:26:23] clean finished in 101 ms [20:26:23] copy started ... [20:26:23] deeplinks started ... [20:26:24] deeplinks finished in 674 ms [20:26:24] transpile started ... [20:26:39] transpile finished in 15.49 s [20:26:39] preprocess started ... [20:26:39] preprocess finished in 1 ms [20:26:39] webpack started ... [20:26:49] copy finished in 26.39 s [20:27:08] webpack finished in 29.23 s [20:27:08] sass started ... Without from option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to
undefinedto prevent this warning. [20:27:20] sass finished in 12.16 s [20:27:20] postprocess started ... [20:27:20] postprocess finished in 33 ms [20:27:20] lint started ... [20:27:20] build dev finished in 58.27 s cordova run android Discovered plugin "mx.ferreyra.callnumber" in config.xml. Adding it to the project [20:27:52] lint finished in 31.61 s Plugin "call-number" already installed on android.
ANDROID_HOME=/Users/adrienv/Library/Android/
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home
(node:83381) UnhandledPromiseRejectionWarning: Error: spawn EACCES at ChildProcess.spawn (internal/child_process.js:330:11) at Object.exports.spawn (child_process.js:500:9) at Object.exports.spawn (/Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:134:31) at GradleBuilder.runGradleWrapper (/Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/lib/builders/GradleBuilder.js:78:27) at /Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/lib/builders/GradleBuilder.js:177:21 at _fulfilled (/Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/node_modules/q/q.js:883:30) at Promise.promise.promiseDispatch (/Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/node_modules/q/q.js:816:13) at /Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/node_modules/q/q.js:570:49 at runSingle (/Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/node_modules/q/q.js:137:13)
(node:83381) 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:83381) [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.
[OK] Your app has been deployed. Did you know you can live-reload changes from your app with --livereload?
MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ echo $ANDROID_HOME /Users/adrienv/Library/Android/
MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ echo $JAVA_HOME
MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/
MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ ionic cordova run android Running app-scripts build: --platform android --target cordova
[20:29:54] build dev started ... [20:29:54] clean started ... [20:29:54] clean finished in 19 ms [20:29:54] copy started ... [20:29:55] deeplinks started ... [20:29:55] deeplinks finished in 641 ms [20:29:55] transpile started ... [20:30:07] transpile finished in 11.85 s [20:30:07] preprocess started ... [20:30:07] preprocess finished in 1 ms [20:30:07] webpack started ...
MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/ MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ ionic cordova run android Running app-scripts build: --platform android --target cordova
[20:30:17] build dev started ... [20:30:17] clean started ... [20:30:17] clean finished in 4 ms [20:30:17] copy started ... [20:30:17] deeplinks started ... [20:30:18] deeplinks finished in 575 ms [20:30:18] transpile started ... [20:30:31] transpile finished in 12.87 s [20:30:31] preprocess started ... [20:30:31] preprocess finished in 1 ms [20:30:31] webpack started ... [20:30:36] copy finished in 19.40 s [20:30:52] webpack finished in 21.62 s [20:30:52] sass started ... Without
fromoption PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to
undefinedto prevent this warning. [20:30:58] sass finished in 5.91 s [20:30:58] postprocess started ... [20:30:58] postprocess finished in 25 ms [20:30:58] lint started ... [20:30:58] build dev finished in 41.40 s
cordova run android Discovered plugin "mx.ferreyra.callnumber" in config.xml. Adding it to the project
[20:31:15] lint finished in 16.32 s Plugin "call-number" already installed on android. (node:83411) UnhandledPromiseRejectionWarning: CordovaError: Failed to run "javac -version", make sure that you have a JDK installed. You can get it from: http://www.oracle.com/technetwork/java/javase/downloads. Your JAVA_HOME is invalid: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/ at /Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/lib/check_reqs.js:47:27 at ChildProcess.exithandler (child_process.js:280:5) at ChildProcess.emit (events.js:180:13) at maybeClose (internal/child_process.js:936:16) at Socket.stream.socket.on (internal/child_process.js:353:11) at Socket.emit (events.js:180:13) at Pipe._handle.close [as _onclose] (net.js:538:12) (node:83411) 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:83411) [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.
[OK] Your app has been deployed. Did you know you can live-reload changes from your app with --livereload?
MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/bin/ MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/bin/ MacBook-Air-de-Adrien:ion2FullApp-ELITE-version adrienv$ ionic cordova run android Running app-scripts build: --platform android --target cordova [20:33:11] build dev started ... [20:33:11] clean started ... [20:33:11] clean finished in 19 ms [20:33:11] copy started ... [20:33:11] deeplinks started ... [20:33:12] deeplinks finished in 557 ms [20:33:12] transpile started ... [20:33:22] transpile finished in 10.71 s [20:33:22] preprocess started ... [20:33:22] preprocess finished in 1 ms [20:33:22] webpack started ... [20:33:25] copy finished in 14.51 s [20:33:42] webpack finished in 19.89 s [20:33:42] sass started ... Without from option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to
undefinedto prevent this warning. [20:33:48] sass finished in 5.57 s [20:33:48] postprocess started ... [20:33:48] postprocess finished in 20 ms [20:33:48] lint started ... [20:33:48] build dev finished in 37.15 s cordova run android Discovered plugin "mx.ferreyra.callnumber" in config.xml. Adding it to the project
[20:34:02] lint finished in 14.12 s Plugin "call-number" already installed on android.
(node:83432) UnhandledPromiseRejectionWarning: CordovaError: Failed to run "javac -version", make sure that you have a JDK installed. You can get it from: http://www.oracle.com/technetwork/java/javase/downloads. Your JAVA_HOME is invalid: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/bin/ at /Users/adrienv/NoiCloud/example/ion2FullApp-ELITE-version/platforms/android/cordova/lib/check_reqs.js:47:27 at ChildProcess.exithandler (child_process.js:280:5) at ChildProcess.emit (events.js:180:13) at maybeClose (internal/child_process.js:936:16) at Socket.stream.socket.on (internal/child_process.js:353:11) at Socket.emit (events.js:180:13) at Pipe._handle.close [as _onclose] (net.js:538:12) (node:83432) 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:83432) [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.
[OK] Your app has been deployed. Did you know you can live-reload changes from your app with --livereload?
[OK] Your app has been deployed.
---------------------------------- END TERMINAL ----------------------------------The prompt say : « Your app has been deployed », but it’s not deployed on my phone (configured on android studio)
If I try to open the project in android studio and build, I got many errors too.
One more time, it’s with a clean package, just downloaded, without any modification. I know your package work, but something in my configuration seems to be bad I think.
Thank so much for your help.