As per this forum post everytime I am running a ionic cordova command in the console, strange numbers appear instead of the cordova information. It is working fine when using cordova directly.
We got this reported in Windows10, Ubuntu and MacOS.
Here are some examples:
Running 'build:before' gulp task before build
[13:55:12] Starting 'clean'...
[13:55:12] Finished 'clean' after 41 ms
[13:55:12] Starting 'build'...
[13:55:12] Starting 'sass'...
[13:55:12] Starting 'html'...
[13:55:12] Starting 'fonts'...
[13:55:12] Starting 'scripts'...
[13:55:12] Finished 'scripts' after 41 ms
[13:55:12] Finished 'html' after 45 ms
[13:55:12] Finished 'fonts' after 46 ms
[13:55:13] Finished 'sass' after 840 ms
[13:55:17] Finished 'build' after 5.04 s
[13:55:17] Starting 'build:before'...
[13:55:17] Finished 'build:before' after 4.75 渭s
0=82, 1=117, 2=110, 3=110, 4=105, 5=110, 6=103, 7=32, 8=99, 9=111, 10=109, 11=109, 12=97, 13=110, 14=100, 15=58, 16=32, 17=47, 18=104, 19=111, 20=109, 21=101, 22=47, 23=115, 24=109, 25=97, 26=114, 27=116, 28=97, 29=100, 30=109, 31=105, 32=110, 33=47, 34=103, 35=105, 36=116, 37=47, 38=105, 39=111, 40=116, 41=47, 42=115, 43=109, 44=97, 45=114, 46=116, 47=104, 48=111, 49=109, 50=101, 51=47, 52=97, 53=112, 54=112, 55=47, 56=109, 57=111, 58=98, 59=105, 60=108, 61=101, 62=47, 63=99, 64=117, 65=116, 66=101, 67=80, 68=117, 69=112, 70=112, 71=121, 72=80, 73=105, 74=99, 75=115, 76=47, 77=104, 78=111, 79=111, 80=107, 81=115, 82=47, 83=97, 84=102, 85=116, 86=101, 87=114, 88=95, 89=112, 90=114, 91=101, 92=112, 93=97, 94=114, 95=101, 96=47, 97=48, 98=49, 99=48, 100=95, 101=97, 102=
Running 'build:before' gulp task before build
[23:24:43] Starting 'clean'...
[23:24:43] Finished 'clean' after 112 ms
[23:24:43] Starting 'build'...
[23:24:43] Starting 'sass'...
[23:24:43] Starting 'html'...
[23:24:43] Starting 'fonts'...
[23:24:43] Starting 'scripts'...
[23:24:43] Finished 'scripts' after 106 ms
[23:24:43] Finished 'html' after 149 ms
[23:24:43] Finished 'fonts' after 146 ms
[23:24:45] Finished 'sass' after 2.06 s
[23:24:56] Finished 'build' after 13 s
[23:24:56] Starting 'build:before'...
[23:24:56] Finished 'build:before' after 7.15 渭s
0=65, 1=78, 2=68, 3=82, 4=79, 5=73, 6=68, 7=95, 8=72, 9=79, 10=77, 11=69, 12=61, 13=47, 14=104, 15=111, 16=109, 17=101, 18=47, 19=106, 20=101, 21=115, 22=117, 23=115, 24=47, 25=65, 26=110, 27=100, 28=114, 29=111, 30=105, 31=100, 32=47, 33=97, 34=110, 35=100, 36=114, 37=111, 38=105, 39=100, 40=45, 41=115, 42=100, 43=107, 44=45, 45=108, 46=105, 47=110, 48=117, 49=120, 50=10
0=74, 1=65, 2=86, 3=65, 4=95, 5=72, 6=79, 7=77, 8=69, 9=61, 10=47, 11=117, 12=115, 13=114, 14=47, 15=108, 16=105, 17=98, 18=47, 19=106, 20=118, 21=109, 22=47, 23=106, 24=100, 25=107, 26=49, 27=46, 28=55, 29=46, 30=48, 31=95, 32=55, 33=57, 34=10
[...]
0=58, 1=99, 2=111, 3=109, 4=112, 5=105, 6=108, 7=101, 8=68, 9=101, 10=98, 11=117, 12=103, 13=78, 14=100, 15=107
0=32
0=85, 1=80, 2=45, 3=84, 4=79, 5=45, 6=68, 7=65, 8=84, 9=69
0=10
0=58, 1=99, 2=111, 3=109, 4=112, 5=105, 6=108, 7=101, 8=68, 9=101, 10=98, 11=117, 12=103, 13=83, 14=111, 15=117, 16=114, 17=99, 18=101, 19=115
0=32
0=85, 1=80, 2=45, 3=84, 4=79, 5=45, 6=68, 7=65, 8=84, 9=69
0=10
0=58, 1=116, 2=114, 3=97, 4=110, 5=115, 6=102, 7=111, 8=114, 9=109, 10=67, 11=108, 12=97, 13=115, 14=115, 15=101, 16=115, 17=87, 18=105, 19=116, 20=104, 21=68, 22=101, 23=120, 24=70, 25=111, 26=114, 27=68, 28=101, 29=98, 30=117, 31=103
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
0=32, 1=70, 2=65, 3=73, 4=76, 5=69, 6=68, 7=10
FAILURE:
Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
>
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/jdk1.7.0_79/bin/java'' finished with non-zero exit value 1
* Try:
Run with
--stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
0=10
0=66, 1=85, 2=73, 3=76, 4=68, 5=32, 6=70, 7=65, 8=73, 9=76, 10=69, 11=68
0=10
0=10
0=84, 1=111, 2=116, 3=97, 4=108, 5=32, 6=116, 7=105, 8=109, 9=101, 10=58, 11=32, 12=52, 13=46, 14=50, 15=53, 16=49, 17=32, 18=115, 19=101, 20=99, 21=115, 22=10
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error: Error code 1 for command: /home/jesus/projects/personal/test-app/ionic-conference-app/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/jesus/projects/personal/test-app/ionic-conference-app/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Caught exception:
undefined
And the ionic infos gathered in the forum post are:
$ ionic info
Your system information:
Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.8
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.4 LTS
Node Version: v6.2.1
Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
OS: (This should be Windows 10)
Node Version: v6.2.1
+1
I can confirm that in my case the reason is the version of node/npm
Fresh installation (node + npm + cordova + ionic) with node v4.4.5 + npm v2.15.5 = it worked fine.
Fresh installation with node v6.2.1 + npm v3.9.3 = gave the error above.
Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.8
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.4 LTS
Node Version: v6.2.1
@dmastag Could you try a version of node that is lower than 6? Thanks!
@jthoms1 just tried it out and can confirm that it is working as usual on Node 5.11. Let me change the Subject of the Issue to reflect where the problem is. Should the issue be now closed or left open for future Node 6 support?
@jthoms1 had some extra time and did a checklist
This is for Windows 10 x64 (naturally a check mark means it works)
I think it is somehow related to https://github.com/driftyco/ionic-cli/issues/1078
@dmastag hey, I am encountering the same error. I switched node versions using nvm and ran ionic build still no luck. Do I have to reinstall ionic with older node version?
@sonnyt there should be no need for that. What node version did you turn to using nvm?
@dmastag I fixed it, turns out I was running wrong version of jdk with wrong java. Thank you!
@sonnyt great but what node version are you on?
Closing as a duplicate of #1078.
Node 6.3.0 is working!
Most helpful comment
@jthoms1 had some extra time and did a checklist
This is for Windows 10 x64 (naturally a check mark means it works)