Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity - Failed to compile resources with the following parameters:

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.

like image 985
Alex Avatar asked Nov 29 '25 07:11

Alex


1 Answers

Got my answer, the issue was that "major version 51" is java 1.7, "version 50" is java 1.6. The solution was to install Java 1.7 and set path accordingly with the following command.

sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
like image 71
Alex Avatar answered Dec 01 '25 22:12

Alex