10

I'm using Crashlytics for my android app, and I have many crashes at ActivityThread.java: android.app.ActivityThread.deliverResults

I put some stack traces here:

Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=0, data=null} to activity {me.robano.android/com.google.android.gms.common.api.GoogleApiActivity}: java.lang.NullPointerException
       at android.app.ActivityThread.deliverResults(ActivityThread.java:3641)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:3684)
       at android.app.ActivityThread.access$1300(ActivityThread.java:166)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5584)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException
       at com.google.android.gms.common.api.GoogleApiActivity.zza(Unknown Source)
       at com.google.android.gms.common.api.GoogleApiActivity.onActivityResult(Unknown Source)
       at android.app.Activity.dispatchActivityResult(Activity.java:5634)
       at android.app.ActivityThread.deliverResults(ActivityThread.java:3637)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:3684)
       at android.app.ActivityThread.access$1300(ActivityThread.java:166)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5584)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
       at dalvik.system.NativeStart.main(NativeStart.java)

I'm also using google firebase in my app.

please help! thanks

MarcSB
  • 1,040
  • 1
  • 12
  • 19
Pooya Saberian
  • 971
  • 2
  • 9
  • 16
  • 1
    Possible duplicate of [What is a NullPointerException, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Yury Fedorov Jul 17 '16 at 06:04
  • 2
    @Orlangure Great, but how does OP fix an error that is caused within the `com.google.android.gms` package? – OneCricketeer Jul 17 '16 at 06:05
  • The problem seems to be some of your devices are sending null data to the Google API `ResultInfo{who=null ... data=null}` – OneCricketeer Jul 17 '16 at 06:06
  • 1
    @pooya seberian : you found any solution? – rakesh kashyap Jul 27 '16 at 04:57
  • @rakeshkashyap not yet – Pooya Saberian Jul 28 '16 at 08:06
  • Having the same problem. This is my main error reported through crashlytics (fabric.io) and I have no way of reproducing it on my devices... – Patrick Boos Aug 09 '16 at 06:16
  • We have a lot of crashes in fabric also (like over 1000) with the same error. Never seen it before moving to Firebase – Dmitry L. Aug 10 '16 at 19:32
  • I have the same problem, also using Firebase... – MarcSB Aug 11 '16 at 15:03
  • Were you able to narrow down the cause? I have the same error in my app and I think it was caused either by adding Firebase Remote Config Library, or switching from Admob banner to small native ads. – w.donahue Aug 16 '16 at 13:52
  • What Google services integration do you have in your app? GoogleApiActivity is usually part of the auto manage set up. Any chance you could post a little more of the code using Firebase? – Ian Barber Aug 29 '16 at 23:26

3 Answers3

0

The problem is definitely in the new Google Services (9.0.0 to 9.4.0). It tries to start something that returns null to the onActivityResult.

Probably the only way to fix this:

PackageManager pm = getPackageManager();
pm.setComponentEnabledSetting(new ComponentName(this, GoogleApiActivity.class), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
Dmitry L.
  • 1,572
  • 1
  • 12
  • 10
0

Upgrading the SDK to the latest version 9.4 of the Google Play Service should fix this issue.

AniV
  • 3,997
  • 1
  • 12
  • 17
0

This is a bug in the Google Play Services SDK, up to 9.4.0. The fix should be in the next release, sorry about that.

Ian Barber
  • 19,765
  • 3
  • 58
  • 58