android-branch-deep-linking-attribution icon indicating copy to clipboard operation
android-branch-deep-linking-attribution copied to clipboard

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void io.branch.referral.Branch$BranchReferralInitListener.onInitFinished(org.json.JSONObject, io.branch.referral.BranchError)' on a null object reference(short issue description)

Open vabhatia opened this issue 2 years ago • 0 comments

Describe the bug

We are seeing ~100 crashes per day with the following stack trace.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void io.branch.referral.Branch$BranchReferralInitListener.onInitFinished(org.json.JSONObject, io.branch.referral.BranchError)' on a null object reference
       at io.branch.referral.ServerRequestRegisterOpen.handleFailure(ServerRequestRegisterOpen.java:95)
       at io.branch.referral.Branch$BranchPostTask.onRequestFailed(Branch.java:2443)
       at io.branch.referral.Branch$BranchPostTask.onPostExecuteInner(Branch.java:2333)
       at io.branch.referral.Branch$BranchPostTask.onPostExecute(Branch.java:2317)
       at io.branch.referral.Branch$BranchPostTask.onPostExecute(Branch.java:2276)
       at android.os.AsyncTask.finish(AsyncTask.java:771)
       at android.os.AsyncTask.access$900(AsyncTask.java:199)
       at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8663)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Steps to reproduce

From Firebase logs, it looks like the app is crashing soon after launch and a lot of instances suggest this as the first launch post update.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void io.branch.referral.Branch$BranchReferralInitListener.onInitFinished(org.json.JSONObject, io.branch.referral.BranchError)' on a null object reference
       at io.branch.referral.ServerRequestRegisterOpen.handleFailure(ServerRequestRegisterOpen.java:95)
       at io.branch.referral.Branch$BranchPostTask.onRequestFailed(Branch.java:2443)
       at io.branch.referral.Branch$BranchPostTask.onPostExecuteInner(Branch.java:2333)
       at io.branch.referral.Branch$BranchPostTask.onPostExecute(Branch.java:2317)
       at io.branch.referral.Branch$BranchPostTask.onPostExecute(Branch.java:2276)
       at android.os.AsyncTask.finish(AsyncTask.java:771)
       at android.os.AsyncTask.access$900(AsyncTask.java:199)
       at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8663)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Expected behavior

No crash is expected.

SDK Version

5.2.0

Make and Model

Multiple Devices

OS

All OS versions above 7

Additional Information/Context

No response

vabhatia avatar Feb 07 '23 04:02 vabhatia