Java.Lang.NoSuchFieldError when using Mono for Android and Facebook SDK
===

So I'm trying out the Xamarin [Facebook Simple sample][1].

Facing initial issues, I had to download and compile the latest Facebook for Android SDK, (using Eclipse) and zipped it for the Facebook java-bindings project.

However, when clicking the logout button, I get this error:

    Java.Lang.NoSuchFieldError: com.facebook.android.R$drawable.close
      at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00023] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.2.4-branch/74c352d0/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:368
      at Com.Facebook.Android.Facebook.Authorize (Android.App.Activity,string[],Com.Facebook.Android.Facebook/IDialogListener) <IL 0x00095, 0x002af>
      at Com.Facebook.Android.LoginButton/ButtonOnClickListener.OnClick (Android.Views.View) [0x00051] in C:\Users\magnus\Downloads\xamarin-monodroid-samples-7e2c105\xamarin-monodroid-samples-7e2c105\Facebook\samples\simple\simple\Example.cs:140
      at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.2.4-branch/74c352d0/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.Views.View.cs:600
      at (wrapper dynamic-method) object.9681ec74-91e4-4ca3-93b5-489e6e022fb2 (intptr,intptr,intptr) <IL 0x00012, 0x0001b>
    
      --- End of managed exception stack trace ---
      java.lang.NoSuchFieldError: com.facebook.android.R$drawable.close
      	at com.facebook.android.FbDialog.createCrossImage(FbDialog.java:106)
      	at com.facebook.android.FbDialog.onCreate(FbDialog.java:81)
      	at android.app.Dialog.dispatchOnCreate(Dialog.java:307)
      	at android.app.Dialog.show(Dialog.java:225)
      	at com.facebook.android.Facebook.dialog(Facebook.java:814)
      	at com.facebook.android.Facebook.startDialogAuth(Facebook.java:343)
      	at com.facebook.android.Facebook.authorize(Facebook.java:206)
      	at com.facebook.android.Facebook.authorize(Facebook.java:125)
      	at com.facebook.android.LoginButton_ButtonOnClickListener.n_onClick(Native Method)
      	at com.facebook.android.LoginButton_ButtonOnClickListener.onClick(LoginButton_ButtonOnClickListener.java:36)
      	at android.view.View.performClick(View.java:2485)
      	at android.view.View$PerformClick.run(View.java:9080)
      	at android.os.Handler.handleCallback(Handler.java:587)
      	at android.os.Handler.dispatchMessage(Handler.java:92)
      	at android.os.Looper.loop(Looper.java:130)
      	at android.app.ActivityThread.main(ActivityThread.java:3683)
      	at java.lang.reflect.Method.invokeNative(Native Method)
      	at java.lang.reflect.Method.invoke(Method.java:507)
      	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
      	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
      	at dalvik.system.NativeStart.main(Native Method)
    
      
Using the exact same JAR in an Eclipse Java project works just fine.  
It would seem that the `R$drawable.close` resource is missing, but it's present in the Zip file.
Any ideas what could be wrong?
  




  [1]: https://github.com/xamarin/monodroid-samples/tree/master/Facebook