Failed to recompile android resource files. See the Console for details

  1. I can see .meta files in the res folder, is it the .meta files causing the error

  2. I have jdk 1.6 installed

  3. I tried competely removed jre so it must be jdk

  4. I import the fb sdk in new unity project, so it is not caused by other plugin…but failed

  5. I read the facebook.com unity sdk page for android many times, it just tell us to import the package…which obviously not work…I guess it need to export to .jar first but dont know the way

  6. I tried to recompile the sdk from the src using eclipse…added the references path, but it shows 689 errors, including missing com.facebook.Session, com.facebook.Internal.Utility etc…failed

  7. I searched stack overflow, placed question…but it seems every is using it with out resource compile error…I cannot find any solution…

  8. I tried all version and find that only version 4.2.4 or below can be used. as it does not contains res, src folder. sdk4.2.4 only have a jar file…

  9. I added this line in the build.xml, try to exclude the problem caused by .meta but failed:

      <property name="aapt.ignore.assets" value="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~:!*.meta" />
    
  10. I have been stucked here for 2 weeks…will be fired by my boss if I cannot fix it…and I have two kids to feed

To reproduce, create a new project import facebook for unity sdk downloaded from facebook (any version above 4.2.4 will cause this error)

-bootclasspath "C:/Users/someone/Desktop/adt-bundle-windows-x86/adt-bundle-windows-x86/sdk/platforms/android-17\android.jar" -d "C:\Users\someone	hefolder\Roster Plus Unity\Facebook sdk 5.0.4\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding ascii "com\facebook\android\R.java" "net	hisismycompany	esting\R.java"
Picked up _JAVA_OPTIONS: -Xmx512M

It stated to see the console for detail, but the command is called by unity, I cannot see the console…

before starting build, disable .meta files. (Edit-ProjectSettings-Editor-VersionControl-Disabled)

Hey there, I was having this same issue. It was solved simply by updating my JDK to 1.8.01. Go Unity > Preferences > External Tools and next to the JDK input press download. It will take you to Oracles download page. After downloading the latest JDK, go back to the External Tools menu and browse for the newly updated JDK.

Good luck!

Just change jdk from 1.7 to 1.8 resolved my issue.