FB.Init - AndroidJavaException: java.lang.ExceptionInInitializerError

I’m using Facebook SDK 7.0.2 for Unity (beta) in Unity 5.0.0f4. Just trying to do some basic stuff: init, login and share.

I’ve managed to perform these actions within the Unity Editor, although the FB.ShareLink method just writes a log saying that “Share Link is not implemented in the Unity editor”.

So I deployed to Android and tried to test, but after calling FB.Init, the adb shows this exception:

I/Unity   ( 2788): AndroidJavaException: java.lang.ExceptionInInitializerError
I/Unity   ( 2788):   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0 
I/Unity   ( 2788):   at UnityEngine.AndroidJNISafe.CallStaticVoidMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0 
I/Unity   ( 2788):   at UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0 
I/Unity   ( 2788):   at UnityEngine.AndroidJavaObject.CallStatic (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0 
I/Unity   ( 2788):   at Facebook.AndroidFacebook.CallFB (System.String method, System.String args) [0x00000] in /Assets/Facebook/Scripts/PlatformAndroid/AndroidFacebook.cs:72 
I/Unity   ( 2788):   at Facebook.AndroidFacebook.Init (Facebook.InitDelegate onInitComplete, System.String appId, Boolean cookie, Boolean logging, Boolean status, Boolean xfbml, System.String channelUrl, System.String authResponse, Boolean fric

and the OnInitComplete delegate I set is never called.

Does anybody else have this problem? Do you know a solution for this?

I haven’t yet tried with iOS, but I’m about to. I’ll keep informing…

This looks like you had an issue when importing the plugin. Try removing the plugin entirely and then reimporting it.