7

I'm getting this error when compiling unity for android using the facebook unity sdk (if I remove the sdk it compiles fine):

Failed to compile resources with the following parameters:
-bootclasspath "/Users/ines/Development/android-sdk-macosx/platforms/android-21/android.jar" -d "/Users/ines/Documents/Game/Temp/StagingArea/bin/classes" -source 1.6 -target 1.6 -encoding UTF-8 "com/RPS/Game/R.java" "com/facebook/android/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()

I cannot understand why this is happening. I'm running Unity 4.6 on OSX 10.9.5 and I have the latest version of Java installed as well as the android skd.

Can anyone help me?

InesM
  • 331
  • 4
  • 16

3 Answers3

0

I am getting identical error since yesterday and after spent whole morning to research. I found that it is cause by the latest Android API version 21. After I revert back to Android API version 20 by deleting all the API version 21 packages in SDK manager and everything back to normal. Hope it helps.

0

The solution for this can be found here: http://answers.unity3d.com/questions/814186/error-when-compiling-android.html

You can try by the terminal itself. Or if something weird happens, as was my case, try manually.

0

I've had the same issue and have tried all the suggestions that have already been made here without success.

What ended up working for me was to delete the "adt-bundle/sdk/platforms/android-21" folder and only leave the "android-20" folder in my case. Check the Android SDK folder you're targeting in your Unity preferences.

Franci
  • 165
  • 2
  • 9