2
votes

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.

3

3 Answers

9
votes

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
0
votes

For me, changing the JDK path at Preferences => External Tools => JDK finally resolved this issue. Creating the symbolic link wasn't enough or possibly not even needed.

0
votes