I have tried to execute the simple “Get Started” tutorial, without edit any file, but simply using this command
$ npm install -g cordova ionic
$ ionic start test tabs
$ ionic platform add android
And all these 3 command work file. After i have run this
$ ionic build android
And the command fails with errors
:compileDebugJavaWithJavacNote: /Users/andreabersi/app/test/platforms/android/src/org/apache/cordova/splashscreen/SplashScreen.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:transformClassesWithDexForDebugException 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)
FAILED
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 ‘/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/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.
BUILD FAILED
Total time: 7.515 secs
I have NOT changed any into the vanilla project; i have an Android Studio with SDK API level 22, 23 and 24 enabled.
The $ java version show
java version “1.7.0_79”
Java™ SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot™ 64-Bit Server VM (build 24.79-b02, mixed mode)
What is broken? this is my first attempt with IONIC and Android
Thank you in advance