- Home /
Resource compilation failed! Failed to recompile android resource files. See the Console for details.
I'm working on adding Google Play Game Services to a Unity project.
Started getting these errors recently, however not sure if it is because of the Game Services, or could be I updated my machine.
The following in Console output:
Failed to compile resources with the following parameters: -bootclasspath "/Users/alex/development/adt-bundle-mac-x86_64-20131030/sdk/platforms/android-21/android.jar" -d "/Users/alex/Documents/development/unity/Maze/Maze/Temp/StagingArea/bin/classes" -source 1.6 -target 1.6 -encoding UTF-8 "com/facebook/android/R.java" "com/google/android/gms/R.java" "com/google/example/games/basegameutils/R.java" "com/google/example/games/mainlibproj/R.java" "com/mildspring/maze/R.java" warning: java/lang/Object.class(java/lang:Object.class): major version 51 is newer than 50, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. 1 warning
UnityEditor.HostView:OnGUI()
Error building Player: UnityException: Resource compilation failed! Failed to recompile android resource files. See the Console for details.
Answer by Trungdv · Nov 11, 2014 at 08:00 AM
You have not installed jdk 1.7 yet or has been installed but did not set Path correctly.
Open Terminal, run:
open ~/.bash_profile
Add these lines into bash_profile:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin export PATH=$JAVA_HOME/bin:$PATH
Run this command:
sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
*NOTE: You should not just copy all of these commands, use your path instead. (For example, my path is jdk1.7.0_71.jdk because my jdk version is jdk7u71, if your version is difference, your path will be difference)
Thank you, this solved the issue, can't up-vote yet, not enough rep.
This solved the issue for me as well. Experienced the issue after updating and installing the latest Android SD$$anonymous$$ packages.
Thanks, this solved my problem too, I'm using 1.8.0_11
I'm just getting setup with all this... do you install the JD$$anonymous$$ or the JD$$anonymous$$ or AR$$anonymous$$ ?
Sorry, I should have been clearer. on the JD$$anonymous$$ download site, there are many options.... Runtime only, developer option etc... after more research... gonna answer my own question.... Download the JD$$anonymous$$ (not JD$$anonymous$$ for AR$$anonymous$$ processor) and pick the version that matches your processor (32bit or 64bit) If you are on mac, I found this tool useful also, to set environment variables in a tool, rather than manually editing.... http://diaryproducts.net/files/EnvPane-0.3.dmg
Answer by DWishR · Nov 28, 2017 at 12:33 AM
For anyone else who ends up here: As of Unity 2017, Unity is incompatible with JDK 9. You need to continue to use JDK 1.8 for the time being.
Answer by donmetapod · Sep 12, 2016 at 04:08 PM
In my case JDK was installed but Unity was pointing to an older version causing the same error.
Answer by lebustamant · Mar 27, 2018 at 11:05 PM
I just got the same issue using 5.6.3p2 and jdk 1.10. Which is the actual, compatible jdk? Or is there a new reason for this error?
I'm having the same problem. Did you figure out a way to fix it?
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Build Error 1 Answer
errors on IL2CPP build 0 Answers
Android Build problem? 2 Answers
Game not working after build 0 Answers