1
votes

i tried to add Ads to my mobile game and then i was going to test it on the phone and suddenly this came up. Yesterday it was all working fine. Does somebody know what those errors mean?

UnityException: Resource compilation failed! Failed to recompile android resource files. See the Console for details. UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message, System.Exception ex) UnityEditor.Android.PostProcessAndroidPlayer.ShowErrDlgAndThrow (System.String title, System.String message) UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries) UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at

and this one

Failed to compile resources with the following parameters: -bootclasspath "C:/Users/Richard/Desktop/android-sdk-windows\platforms\android-24\android.jar" -d "C:\Users\Richard\Desktop\BMP Jumper\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\MobileTest\Test\R.java" "com\unity3d\ads\android\R.java" warning: C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/AutoCloseable.class): major version 52 is newer than 51, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. 2 warnings

ailed to compile resources with the following parameters: -bootclasspath "C:/Users/Richard/Desktop/android-sdk-windows\platforms\android-24\android.jar" -d "C:\Users\Richard\Desktop\BMP Jumper\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\MobileTest\Test\R.java" "com\unity3d\ads\android\R.java" warning: C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/Object.class): major version 52 is newer than 51, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. warning: C:\Users\Richard\Desktop\android-sdk-windows\platforms\android-24\android.jar(java/lang/AutoCloseable.class): major version 52 is newer than 51, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. 2 warnings

2
Did you add any new plugin to your game?Programmer
I dont think so.. all i did was i allowed unity ads in my project.Richarrd82

2 Answers

0
votes

I see that this is repeated many times in the error message: "major version 52 is newer than 51, the highest major version supported by this compiler." So I'd recommend you to uninstall Android API 24 (that is Nougat) from your PC using SDK manager. Also are you using the newest Unity 5.4?

0
votes

major version 52 is newer than 51, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. 2 warnings

This means that the Java environment you currently have cannot process the Java classes in your project, since they were compiled using a higher version compiler.

In simpler terms - a class with version 52.0 was compiled with a Java 8 compiler, but your local JDK is probably of a lower version.

The simplest fix is to install JDK 8 and then set Unity to use it (Preferences -> External Toolls).

If this still does not work, you can also check out this service for fixing Android specific build issues with Unity (DISCLAIMER: the service is provided by me)