Mac / Unsupported major.minor version 52.0

If I create an empty test project and try to launch it on Android I get the following error:

LogPlayLevel: [buildconfig] Generating BuildConfig class.
LogPlayLevel: -pre-compile:
LogPlayLevel: -compile:
LogPlayLevel:     [javac] Compiling 26 source files to /Users/test/Documents/Unreal Projects/Test/Intermediate/Android/APK/bin/classes
LogPlayLevel:     [javac] Note: /Users/test/Documents/Unreal Projects/Test/Intermediate/Android/APK/src/com/android/vending/licensing/LicenseChecker.java uses or overrides a deprecated API.
LogPlayLevel:     [javac] Note: Recompile with -Xlint:deprecation for details.
LogPlayLevel: -post-compile:
LogPlayLevel: -obfuscate:
LogPlayLevel: -dex:
LogPlayLevel:       [dex] input: /Users/test/Documents/Unreal Projects/Test/Intermediate/Android/APK/bin/classes

LogPlayLevel:       [dex] input: /Users/test/Documents/Unreal Projects/Test/Intermediate/Android/APK/JavaLibs/play-services-base-9.2.0/libs/play-services-base-9.2.0.jar
LogPlayLevel:       [dex] Pre-Dexing /Users/test/Documents/Unreal Projects/Test/Intermediate/Android/APK/JavaLibs/downloader_library/bin/classes.jar -> classes-275154f089294ec03068b780d33b7cdc.jar
LogPlayLevel:        [dx] Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
LogPlayLevel:        [dx]     at java.lang.ClassLoader.defineClass1(Native Method)
LogPlayLevel:        [dx]     at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
LogPlayLevel:        [dx]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
LogPlayLevel:        [dx]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
LogPlayLevel:        [dx]     at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
LogPlayLevel:        [dx]     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
LogPlayLevel:        [dx]     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
LogPlayLevel:        [dx]     at java.security.AccessController.doPrivileged(Native Method)
LogPlayLevel:        [dx]     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
LogPlayLevel:        [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
LogPlayLevel:        [dx]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
LogPlayLevel:        [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
LogPlayLevel:        [dx]     at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
LogPlayLevel: BUILD FAILED

The problem is new to UE4.13 (my configuration used to work fine before)

Any idea of what the problem is?

Full log:

Hello devel.bmad,

I found this line within your logs which leads me to believe if you just delete your Saved and Intermediate folders your issue will be resolved.

Program.Main: ERROR: AutomationTool terminated with exception: System.IO.FileNotFoundException: /Users/test/Documents/Unreal Projects/Test/Intermediate/Android/APK/bin/Test-debug.apk does not exist

It seems to be looking for a file that does not exist. Possibly because this is a project that was upgraded from 4.12 to 4.13 and is holding onto old references.

Let me know if you need further assistance or have additional questions.

Thanks,

Hello Andrew, unfortunately that didn’t fix the issue. Plus, the project was an empty project created from scratch with 4.13. “Unsupported major.minor version 52.0” seems to refer some tool trying to use to java 1.8, while on my mac there is 1.7 Everything was working fine before 4.13, did some of the dependency changed? e.g. ant or ndk version?

We did have a change in support for Mac OS for 4.13 so this could be part of the issue.

I would make sure all your SDK’s and other dependencies are in their most up to date version. I will say there is a known issue with Xcode 8 which requires users to remove a file for it to work as expected.

Let me know if you have further questions.

Cheers,

Which file should be removed for xcode 8?

From the logs I linked above is it possible to understand what’s going wrong?

The problem arises only in the final packaging steps of the apk, and seems to be linked to the use of the dx tool…

It is hard to gather context from the logs and understand what is exactly going wrong. For the file needing to be removed follow the link below.

Have you attempted to modify your packaging settings or does this fail under any build configuration?

Fixed by setting the JAVA_HOME env variable to a 1.8 JRE.

Apparently, upgrading Android Studio to the latest edition installed a JRE 1.8 on my system. Unreal Engine was supposed to use the older version (the one pointed by the JAVA_HOME variable), but apparently some tool in the Android toolchain required JAVA8 now (my Android toolchain has not been completely installed with AndroidWorks, since I already had part of the tools)

Any configuration was failing. Fixed by setting the JAVA_HOME env variable to a 1.8 JRE. Thanks anyway!