I know, Unity 4.x old, but I’m just trying to get rid of an old project by releasing it for Android without having to go through quite a hassle in upgrading the project to Unity 5. So, the problem is that when running the game on Android it instantly crashes due to this:
E/AndroidRuntime( 5614): Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.facebook.FacebookContentProvider” on path: /data/app/myapk.apk
E/AndroidRuntime( 5614): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
E/AndroidRuntime( 5614): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime( 5614): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime( 5614): at android.app.ActivityThread.installProvider(ActivityThread.java:4969)
E/AndroidRuntime( 5614): … 12 more
If I go to the Plugins/Android/AndroidManifest.xml and comment out this:
<provider android:name=“com.facebook.FacebookContentProvider”
The game does run, but then (perhaps unsurprisingly) if trying to use the Facebook integration, it crashes.
Any idea, what’s wrong? I’ve tried to clean old stuff from potential earlier Facebook SDK’s, but I still get this issue. The Facebook SDK is old too (6.2.2.) but it’s the last one that supports Unity 4.
On Facebook developer discussions there was the assumption that an error like this would be caused by Unity 4 not supporting .aar files, but the Facebook SDK 6.2.2. (nor my project otherwise) doesn’t have any .aar files, so that shouldn’t be the issue.
So any ideas how to fix this?