# Unable to build android with vanilla project

**URL:** <https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794>\
**Category:** ionic-v1\
**Created:** [June 25, 2016, 3:57pm UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794 "2016-06-25T15:57:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![abmcr](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@abmcr](https://forum.ionicframework.com/u/abmcr)\
**Post date:** [June 25, 2016, 3:57pm UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/1 "2016-06-25T15:57:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gimimimi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gimimimi/32/101391_2.png) [@Gimimimi](https://forum.ionicframework.com/u/Gimimimi)\
**Post date:** [June 28, 2016, 5:02am UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/2 "2016-06-28T05:02:38Z")

</div>

Same problem here. Is there a preferred version of JDK to use with ionic? already tried 7.0\_79 and \_80 (both x86 and x64), they all failed. Just to be clear, I altered JAVA\_HOME in every trial.

The error occurs with the plain examples from ionic (blank, sidemenu and tabs):

“Execution failed for task ‘:transformClassesWithDexForDebug’.”

I tried adding " multiDexEnabled true" to my build.gradle, turns out the error is only delayed to arise with: “transformClassesWithMultidexListForDebug”.

---

<div class="post-metadata">

**Author:** ![Gimimimi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gimimimi/32/101391_2.png) [@Gimimimi](https://forum.ionicframework.com/u/Gimimimi)\
**Post date:** [June 28, 2016, 6:41pm UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/3 "2016-06-28T18:41:49Z")

</div>

It is probably the Java version. Turns out ionic getting started page directs you to the Android platform installation process, which referes to an old version of java (java 7). JDK 8 can be downloaded from here:

[http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

I will test it when I get home, but that is most likely the reason.

---

<div class="post-metadata">

**Author:** ![abmcr](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@abmcr](https://forum.ionicframework.com/u/abmcr)\
**Post date:** [June 30, 2016, 4:16pm UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/4 "2016-06-30T16:16:02Z")

</div>

Ok  
I have reinstall the JDK 8 and all work now  
Thank you

---

<div class="post-metadata">

**Author:** ![WingTaiRGBG](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@WingTaiRGBG](https://forum.ionicframework.com/u/WingTaiRGBG)\
**Post date:** [August 22, 2016, 2:43pm UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/5 "2016-08-22T14:43:44Z")

</div>

U saved my life. I was searching for days…

---

<div class="post-metadata">

**Author:** ![yassersyndicate](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/yassersyndicate/32/104148_2.png) [@yassersyndicate](https://forum.ionicframework.com/u/yassersyndicate)\
**Post date:** [October 23, 2016, 3:45pm UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/6 "2016-10-23T15:45:30Z")

</div>

this fixed my problem thank you

---

<div class="post-metadata">

**Author:** ![BartVanGompel](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bartvangompel/32/13823_2.png) [@BartVanGompel](https://forum.ionicframework.com/u/BartVanGompel)\
**Post date:** [October 31, 2016, 10:37am UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/7 "2016-10-31T10:37:52Z")

</div>

Thanks so much! 😃  
It fixed the problem for me as well  
👍 👍 👍 👌 ✌

---

<div class="post-metadata">

**Author:** ![b1x1t0](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/b1x1t0/32/99151_2.png) [@b1x1t0](https://forum.ionicframework.com/u/b1x1t0)\
**Post date:** [November 2, 2016, 3:25pm UTC](https://forum.ionicframework.com/t/unable-to-build-android-with-vanilla-project/55794/8 "2016-11-02T15:25:17Z")

</div>

You save my life today :3 \<3
