Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by arun41 · Jul 11, 2019 at 01:37 PM · facebook

Unity Facebook plugin FacebookContentProvider not found runtime exception.

I add facebook plugin to my project, follow all the steps.It is working fine in unity editor. when i tried exporting a build and tested on android device it is not working. The app crash on the initial launch itself.It closes immediately.

I tried connecting the app to the adb logcat and found some errors on the log, which is follows.

 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)

If i tried commenting the FacebookContentProvider in the AndroidManifest.xml file then the app fails on the facebook initialisation. It throws Facebook is not initialised error.

Anyone Please let me know what i am missing on this. My Unity Version is 2018.4.3f1.

,I add facebook plugin to my project, follow all the steps.It is working fine in unity editor. when i tried exporting a build and tested on android device it is not working. The app crash on the initial launch itself.It closes immediately.

I tried connecting the app to the adb logcat and found some errors on the log, which is follows.

 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)



If i tried commenting the FacebookContentProvider in the AndroidManifest.xml file then the app fails on the facebook initialisation. It throws Facebook is not initialised error.

Anyone Please let me know what i am missing on this. My Unity Version is 2018.4.3f1.

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image unity_91BnGyqxSYUPdQ · Oct 29, 2019 at 06:06 AM 0
Share

Hello guys

I am also facing the same issue I'm using Unity version 2017.4.27f1.

hoping to get some answers to the same.

avatar image litebox unity_91BnGyqxSYUPdQ · Jan 08, 2020 at 06:18 PM 0
Share

Try this solution: https://github.com/facebook/facebook-sdk-for-unity/issues/294

avatar image GunLengend · Feb 08, 2020 at 01:37 AM 0
Share

I'm facing the same issue on Unity 2019.3.0f6 with Facebook SDK 7.18.1. Hope to find out solution

avatar image FlyingSquirrels GunLengend · Sep 11, 2020 at 05:17 PM 0
Share

Try to follow this closed thread

OR the new one here.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by shaldar · Nov 23, 2019 at 03:13 AM

I struggled with the same thing. Crashing on android at the very startup with the provider class not found" error. I was just trying to FB login from the Unity app and get profile picture and name.

I used the latest available FB for Unity SDK (v7.18.0 ). Banged my head around quite a bit - changing AndroidManifest, changing the gradle, messing around with proguard file etc. Nothing worked.

Finally I solved it by using a previous version of Facebook SDK (v7.15. Ithink). This version has a bigger footprint and more libraries. I didn't face the FacebookContentProvider not found problem any more and after a bit of struggle ( duplicate classes and linking issues), I got the build to work on android...

IMHO, the current Facebook SDK version for Unity looks stunted and incomplete. I raised a bug report with no response to date.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image unity_91BnGyqxSYUPdQ · Nov 25, 2019 at 05:27 AM 0
Share

Hello

I was able to solve this issue by searching for the FBSD$$anonymous$$ files in the Xcode project then deselect any checkmarks on all the 3 files.

NOTE : Remember to open the "Unity-iPhone.xcworkspace" And not the "Unity-iPhone.xcodeproj".

Hope this helps.

avatar image
1

Answer by Kornikolia · Feb 11, 2020 at 02:13 PM

@GunLengend , try to make "clear" resolve of packages:

  1. "/Assets/Play Service Resolver/Android Resolver/Delete Resolved Libraries"

  2. "/Assets/Play Service Resolver/Android Resolver/Resolve"

Should work now (at least works for me FB 7.18.1 & Unity 2019.2.17f1)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image puap · Feb 12, 2020 at 05:28 AM 0
Share

This worked for me. On PC the play services resolver didn’t automatically run. Had to do it manually

avatar image
0

Answer by Valhalaru · 6 days ago

Facebook Unity SDK Proper Setup and Fixing Didn't find class com.facebook.FacebookContentProvider

  • Overview

    The step by step process of getting the Unity side of FB setup and running by importing the right packages. Also fixes the error – Error AndroidRuntime java.lang.RuntimeException: Unable to get provider com.facebook.FacebookContentProvider: java.lang.ClassNotFoundException: Didn't find class "com.facebook.FacebookContentProvider…”


  • Steps

    1. Delete any previous Unity Facebook SDKs and re-import the latest. Follow the steps here: https://stackoverflow.com/questions/48275051/unity-cant-build-android-with-facebook-sdk • Delete Facebook SDK folder.

• Delete `PlayServicesResolver folder.

• Delete Plugins Folder.

• Now comment the code using Facebook API and namespaces.

• Now import latest FacebookSDK and configure it with project details in Edit-setting option. In Assets->ImportPackage->CustomPackage->latestFBUnityPackage In my case it was “facebook-unity-sdk-11.0.0”

• Now regenerate Android Manifest file and uncomment the code.

  1. Delete the Assets\PlayServicesResolver Folder again

  2. Download the ExternalDependencyManager and unzip, from here: https://github.com/googlesamples/unity-jar-resolver

  3. In Unity import the “external-dependency-manager-latest” unity package

  4. If the Unity Menu “Assets->ExternalDependencyManager” does not showup goto Assets\ExternalDependencyManager\Editor\1.2.171\, select all the DLLs (in my case there were four). Then In the Unity Inspector for the four DLLs select INCLUDE PLATFORMS->EDITOR. Then hit the “Apply” button

  5. In Unity Assets\FacebookSDK\Plugins\Editor\Dependencies – change the 12 to 11.3.

    
        androidPackage spec="com.facebook.android:facebook-core:[11.0, 11.3)" />
        androidPackage spec="com.facebook.android:facebook-applinks:[11.0, 11.3)" />
        androidPackage spec="com.facebook.android:facebook-login:[11.0, 11.3)" />
        androidPackage spec="com.facebook.android:facebook-share:[11.0, 11.3)" />
        androidPackage spec="com.facebook.android:facebook-gamingservices:[11.0, 11.3)" />
    
    

  6. In Unity->Player Settings->Android->Publishing – Build – Check the boxes to generate the following: Custom Main Manifest; Custom Main Gradle Template; Custom Gradle Properties Template; Custom Proguard File

  7. In Assets\Plugins\Android – proguard-user.txt – add the following two lines:

    
        -keep class com.facebook.internal.** {public *;}
        -keep class com.facebook.** {public *; }
    
    

  8. In the Unity dropdown menu, select the following option to Resolve the Android dependencies: Assets->ExternalDependencyManager->Android->Resolve Step 9: Solution From - https://github.com/facebook/facebook-sdk-for-unity/issues/509

  9. The error should be resolved and you should be able to run your app with the Facebook SDK. If it doesn’t work, keep working at it, you will get it!


Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

117 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Invite facebook friends? 1 Answer

Facebook sdk for ios 9 is not opening the app when logging in, Why? 1 Answer

Do our company need a Facebook business account for integrating our unity game? 1 Answer

Facebook SDK Login Loads for a long time 0 Answers

Assets/scripts/fbLogin.cs(60,52): error CS1501: No overload for method `API' takes `3' arguments 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges