[SOLVED] Facebook plugin FacebookContentProvider not found runtime exception

I add facebook plugin to my project, follow all steps according to http://docs.sdkbox.com/en/plugins/facebook/v3-cpp/
Used 23sdk with console compile tool “cocos compile -p android --android-studio” or android studio, both have same result, runtime exception.

That my project.properties file
target=android-23
android.library.reference.1=…/cocos2d/cocos/platform/android/java/libs/facebook_lib/



And such folder exists in those path. And even on building project
Evaluating project ‘:facebook_lib’ using build file ‘\cocos2d\cocos\platform\android\java\libs\facebook_lib\build.gradle’, it seems to build just fine.

As i saw facebook_lib must be linked to my project but nope. So i add to my builde.gradle file additional facebooksdk dependecy compile (‘com.facebook.android:facebook-android-sdk:4.+’), and now it works.
So basicly question is “is facebook plugin working corectly, and does it cotains facebook sdk inside? or i do something wronk in linking facebook_lib dependency”

More over in eclipse project and compiling tool without --android-studio it works fine with just android.library.reference.1=…/cocos2d/cocos/platform/android/java/libs/facebook_lib/ dependency. Maybe issue in multiDexSupport that i enable in android-studio project?

Trace
java.lang.RuntimeException: Unable to get provider com.facebook.FacebookContentProvider: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: DexPathList[[zip file “/data/app/com.studio.halfo-1/base.apk”],nativeLibraryDirectories=[/data/app/com.studio.halfo-1/lib/arm, /data/app/com.studio.halfo-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:5175)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4767)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.access$1600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: DexPathList[[zip file “/data/app/com.studio.halfo-1/base.apk”],nativeLibraryDirectories=[/data/app/com.studio.halfo-1/lib/arm, /data/app/com.studio.halfo-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.ActivityThread.installProvider(ActivityThread.java:5160)
… 10 more
Suppressed: java.lang.ClassNotFoundException: com.facebook.FacebookContentProvider
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)

It dose contain facebook sdk inside, so in your case it’s possible that the SDKBOX installer did not install the facebook sdk correctly

So you think it will be fine if i manually add facebook-android-sdk to build.gradle file?

Yes, it will be fine.