Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK for Android throwing ClassNotFound exception

My latest version of the app has been throwing this error occasionally:

Caused by: java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object (name = com.facebook.friends.constants.FriendRequestMakeRef)

Here is the stack down to the line which causes it:

   at android.os.Parcel.readSerializable(Parcel.java:2148)
   at android.os.Parcel.readValue(Parcel.java:2016)
   at android.os.Parcel.readMapInternal(Parcel.java:2226)
   at android.os.Bundle.unparcel(Bundle.java:223)
   at android.os.Bundle.getString(Bundle.java:1055)
   at android.content.Intent.getStringExtra(Intent.java:4426)

It's being thrown when I do getStringExtra on a Bundle as you can see. It looks like the Facebook SDK is adding an object to the bundle that upon reading, cannot find a class for and then crashes. The string I'm looking for on this line has nothing to do with Facebook.

I haven't changed anything related to the Facebook SDK for a long time, but all of the sudden this is popping up. I attribute it to my switch from the old ANT style compilation to Gradle, as that's the only thing that changed between the older versions and this new version getting the error.

Anyways, I searched around and found literally nothing on this. What's more, I don't blame it for crashing, the Facebook SDK version I'm using doesn't even have a package com.facebook.friends.constants

Has anyone run into this?

like image 431
JMRboosties Avatar asked Jul 02 '14 22:07

JMRboosties


People also ask

Is Facebook SDK deprecated?

Below are the versions of the Facebook Platform SDKs that are deprecated and associated dates: January 19, 2021 - iOS SDK v8. 2 and below. January 19, 2021 - Android SDK v8.

What SDK does Facebook use?

To learn more about using Facebook development tools, see App Development. The current version of the Facebook SDK for Android is version 14.1. 1 and requires the Android API 15. Code and samples for the Facebook SDK for Android are available on GitHub.


1 Answers

Upgrading SDK to the latest version will solve the problem

like image 135
Bishan Avatar answered Nov 15 '22 22:11

Bishan