Android Build Crashes on Start: Didn't find class "com.facebook.FacebookContentProvider"

Using Unity 2017.1.2f1, I built my app for Android. Build completed successfully. I used “Build & Run”, which loaded it onto the Android device I have attached to my PC via USB.

When the app starts on my Android device, it says, “Unfortunately, Bingo has stopped.”

Looking at the logcat, I see this:

E/AndroidRuntime(24085): FATAL EXCEPTION: main
E/AndroidRuntime(24085): Process: com.darrensmith.net.bingo, PID: 24085
E/AndroidRuntime(24085): 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.darrensmith.net.bingo-2.apk”],nativeLibraryDirectories=[/data/app-lib/com.darrensmith.net.bingo-2, /vendor/lib, /system/lib]]
E/AndroidRuntime(24085): at android.app.ActivityThread.installProvider(ActivityThread.java:5121)
E/AndroidRuntime(24085): at android.app.ActivityThread.installContentProviders(ActivityThread.java:4713)
E/AndroidRuntime(24085): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4596)
E/AndroidRuntime(24085): at android.app.ActivityThread.access$1600(ActivityThread.java:169)
E/AndroidRuntime(24085): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
E/AndroidRuntime(24085): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(24085): at android.os.Looper.loop(Looper.java:146)
E/AndroidRuntime(24085): at android.app.ActivityThread.main(ActivityThread.java:5487)
E/AndroidRuntime(24085): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(24085): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(24085): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
E/AndroidRuntime(24085): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
E/AndroidRuntime(24085): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(24085): Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: DexPathList[[zip file “/data/app/com.darrensmith.net.bingo-2.apk”],nativeLibraryDirectories=[/data/app-lib/com.darrensmith.net.bingo-2, /vendor/lib, /system/lib]]
E/AndroidRuntime(24085): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
E/AndroidRuntime(24085): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
E/AndroidRuntime(24085): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
E/AndroidRuntime(24085): at android.app.ActivityThread.installProvider(ActivityThread.java:5106)
E/AndroidRuntime(24085): … 12 more

What could cause the class com.facebook.FacebookContentProvider to not be found?

This app builds & runs successfully in iOS and Windows.

Hey, I got this same error. I’m using Unity 5.6.6 on a scene which includes no facebook activity, and I marked the fb plugin folders to be excluded from the build with ~

I’m sorry I don’t recall what I did to get it to eventually build. advice: Update Unity & Facebook to latest versions and try again. Make sure you have the Facebook settings correct in Unity. Select Facebook->Edit Settings from the toolbar, and check that everything there is correct.

Thanks for the reply man, unfortunately I’m on a large project where I can’t upgrade Unity, and actually don’t have access to the FB developer settings. I’m guessing a setting is messed up

Hello Guys,

I am facing the same issue currently Im on Unity version - 2017.4.27f1 and I’m currently upgraded to Facebook version 7.18.0 and getting the same issue any one know how to fix the same.

Looking forward to getting so inputs from you all on how to fix this.

Same on Unity 2019.2.3f1 / fb SDK 7.18.0

Same here too. Unity 2019.3.0f3, version 7.18.0. My issue on github.

Try exporting Android Studio project and using that same class in Java code. If it’s available there, look into Proguard settings.

I did this

1 Like

Thank you! I had the same issue and this helped

I hate SO MUCH facebook.
Every time facebook give problem.
anyone have solved?

FacebookContentProvider is part of core facebook libraries. Once check if EMDU( Aka Jar Resolver) resolved all of your libraries successfully. If not,

  1. Delete Assets/External Dependency Manager folder
  2. Try downloading the latest copy from here.

A

Thanks, i tried but i did non solved…

At the end I just added the fb sdk on the project and it worked correctly…
I do not understand why admob mediation for facebook did not downloaded the right stuff…

In that case it looks like FB SDK’s dependency xml is not properly imported earlier.
Anyways, glad its working now!

I think is not that beacuse it appens on 3 projects and i reimported the fb sdk FOUR TIME each time on each project.

Oh ok! Strange!

For everyone like me comes here because they can’t install the app on their devices after deleting the Facebook SDK. Even after deleting the Facebook SDK, some lines about it remain in the Manifest.xml file. The root of the problem is there. I deleted everything related to Facebook and after restarting the project, everything went ok.

3 Likes