Strange error while building with ionic 2.0.0-beta.30


#1

Today I upgraded my ionic CLI version from 2.0.0-beta.25 to 2.0.0-beta.30. I tried the simple app using following command and it worked fine.

ionic start cutePuppyPics --v2

But when I tried to build the app for android (I added android platform before the build), I got following strange error and apk file is not generated.

ionic build android
 
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=

#2

I am getting the same problem here. Seems its happening on all cordova commands. (build, platform, plugin).


#3

@satishsmartalyse what is your ionic info output? Here is mine:

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

#4

@satishsmartalyse I haven’t seen this error before, could you open an issue about this?


#5

I can confirm the same output on OSX with the same versions of node and ionic


#6

Same here:

$ 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

Output bellow

$ ionic build android

    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

#7

Here is the issue I created:


#8

@dmastag Thanks for opening the issue. I noticed that you’re using Node v6 which is not officially supported by Ionic (see the Github issue below). I would recommend you to install the latest release of Node v5.


#9

@iignatov can confirm that it is working as usual once I updated to Node 5.11. I also had some Extra time and found out that it is only not working on Node 6.2.1

Node 5.11.0 - working as usual
Node 6.0.0 - working as usual
Node 6.1.0 - working as usual
Node 6.2.0 - working as usual
Node 6.2.1 - strange numbers


#10

I’m glad that you got it working. Thanks for taking the extra time to test with different environments. I believe that it would help to isolate the problem.