Unity error after adding ads Failed to recompile android resource files. How to fix?
Like it says in the title the game built and ran perfect before i added in Unity ads following the Unity documentation https://docs.unity3d.com/Manual/UnityAdsHowTo.html
Things ive tried so far
Deleting 24.0.0 from build tools in the android sdk
Updating the android sdk
the console reads:
Failed to compile resources with the following parameters: -bootclasspath "C:/Users/MyName/Desktop/android-sdk_r24.4.1-windows/android-sdk-windows\platforms\android-24\android.jar" -d "C:\Users\MyName\Desktop\TestGame\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\GenricName24\TestGame\R.java" "com\unity3d\ads\android\R.java" warning: C:\Users\MyName\Desktop\android-sdk_r24.4.1-windows\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\MyName\Desktop\android-sdk_r24.4.1-windows\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
UnityEditor.HostView:OnGUI()
you should provide the full error message from your console, without that it's pretty difficult to know what is the issue.
Answer by liortal · Sep 12, 2016 at 04:41 PM
You should install JDK 8. After you install it, you should make sure that Unity will use that particular version (you can help multiple different JDKs installed on the same machine).
This is done from the Preferences menu (under External Tools). Once you set that up, try to build again. It should work this time :)
please mark this as the answer to your issue to help others.
Your answer
![](https://koobas.hobune.stream/wayback/20220612092625im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Realidad aumentada Vuforia problema creando apk 0 Answers
On Android, my 25MB Game takes a very long time to install. How can I fix this. 0 Answers
Mac JDK error on build 2 Answers
Failed to re-package resources. 0 Answers
Compile failure apk with Vuforia 0 Answers