Description
When building with Android SDK Build-tools > 24.0 and Java < 1.8 the dexer step in the build process bombs out with the below, these build tools seem to require 1.8 [link](
http://stackoverflow.com/questions/39116095/android-studio-buildtools-24-0-1-requires-java-1-8-or-above)
[ERROR] Failed to run dexer:
[ERROR]
[ERROR] java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
[ERROR] at java.lang.ClassLoader.defineClass1(Native Method)
[ERROR] at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
[ERROR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[ERROR] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
[ERROR] at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[ERROR] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
[ERROR] Exception in thread "main"
*WORKAROUND*
Install Java 1.8
Steps to reproduce
Install Android SDK Build-tools > 24.0 and a Java version < 1.7
Build for Android
Actual result
Build will fail with the error above
Expected result
Some help for the user in clarifying what's wrong
[~eharris] I believe 24 is used for Android N, and I think we haven't announced support for build tools 24. Can you verify if you face the same issue on mac? I'll plan this accordingly for the titanium SDK release that supports Android N.
If I'm not wrong, we just need to upgrade the java to 1.8 and need not do anything else. In the future though, we might need to change our toolchain for building android using Jack. https://developer.android.com/guide/platform/j8-jack.html In the mean time, it's not needed.
[~cng] Yes this happens on mac also.
I'm not certain this is an issue once TIMOB-24555 is merged. I have been able to successfully build an Android app using build tools 25 + platform tools 25 + android tools 26 + android sdk 25 (7.1.1) using TIMOB-24555. Once TIMOB-24555 is merged, we can re-test this and see if it's still valid.
For those having this problem, you can find the latest JDK here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
[#PR-9274](https://github.com/appcelerator/titanium_mobile/pull/9274) will change our versioning to require build-tools
26.0
andJDK 1.8
Verified in 6.2.0.v20170824144806 and 7.0.0.v20170823165814 When using Java 1.7 in SDK 6.2.0, when building for Android the CLI (appc and ti) will error out with the error below