NPE on Facebook SDK 4.10 : Attempt to invoke interface method 'java.lang.Object com.facebook.inject.Lazy.get()' on a null object reference

Background

Recently we've updated the Facebook SDK library to 4.10 (from here).

Before, we had the same bug now and then, but now it seems it occurs a lot more often.

The problem

There is no way for us to understand where and why it occurs.

Here's the crash log:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object com.facebook.inject.Lazy.get()' on a null object reference at android.os.Parcel.readException(Parcel.java:1552) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142) at android.content.ContentProviderProxy.query(ContentProviderNative.java:421) at android.content.ContentResolver.query(ContentResolver.java:494) at android.content.ContentResolver.query(ContentResolver.java:429) at com.facebook.internal.NativeProtocol.fetchAllAvailableProtocolVersionsForAppInfo(NativeProtocol.java:790) at com.facebook.internal.NativeProtocol.access$000(NativeProtocol.java:49) at com.facebook.internal.NativeProtocol$NativeAppInfo.fetchAvailableVersions(NativeProtocol.java:281) at com.facebook.internal.NativeProtocol$NativeAppInfo.access$600(NativeProtocol.java:226) at com.facebook.internal.NativeProtocol$1.run(NativeProtocol.java:763) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

And, since it's a report from Crashlytics, I also have some statistics:

  • usually (90%) occurs on Meizu devices, and the rest on LG, Samsung and others.
  • usually (72%) occurs on Android 5.1 versions, and the rest on all of the other versions we support (4.x and above).
What I've tried

I tried searching for the exception, but I can't find anything even similar to it.

I tried to find the "com.facebook.inject.Lazy" class, but this is nowhere to be found. I can't even find injection related classes and repos that the sdk uses for normal use. Only for unit testings.

I also tried to go to the Github website of Facebook (here), but there is nowhere to write there.

Later I've found that this was reported on Facebook's developers website , but it doesn't seem that it's going to be fixed, and nobody knows how to handle it.

EDIT: now I've found this Facebook post, which says it might be because of using an old version of Facebook app, but it seem that it's incorrect.

The question

Why does it occur? Is there any workaround for this? Does Facebook work on a fix for this?

Is there any version of the Facebook SDK that this issue doesn't occur?

And, most importantly, How can it be handled and fixed?

Answers


Please use updated facebook sdk to overcome this error. old sdk has some problems. you can download latest sdk from

https://developers.facebook.com/docs/android


Need Your Help

Save text file in UTF-8 encoding using cmd.exe

windows encoding utf-8 cmd

Is it possible to save a text file in UTF-8 encoding using Windows' command line cmd.exe?

Git merge is not possible because I have unmerged files

git github merge

GIT continues to confound me with its unhelpful error warnings :(