0

So I'm running google-play-services:8.4.0, and for quite some users I'm getting the following error. This happens in the background as I have no logs of things happening before, even days before. (I didn't get any crashes on 8.3.0)

Here is the gradle specs :

'com.google.android.gms:play-services-base:8.4.0',
'com.google.android.gms:play-services-maps:8.4.0',
'com.google.android.gms:play-services-appindexing:8.4.0',
'com.google.android.gms:play-services-analytics:8.4.0',
'com.google.android.gms:play-services-gcm:8.4.0'

And the crash log :

java.lang.NullPointerException: Attempt to invoke interface method 'void com.google.android.gms.common.api.ResultCallback.a(com.google.android.gms.common.api.Result)' on a null object reference
at com.google.android.gms.common.api.internal.zzb$zza.b(Unknown Source)
at com.google.android.gms.common.api.internal.zzb$zza.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

As I can't reproduce this bug, anyone has a hint of what is going wrong in there ?

unseen07
  • 1
  • 1
  • Try to check this SO question [34398191](http://stackoverflow.com/questions/34398191/found-com-google-android-gmsplay-services8-4-0-but-version-8-3-0-is-needed-fo) and [34478757](http://stackoverflow.com/questions/34478757/after-upgrading-to-google-play-services-8-4-0-my-app-crashes-on-startup), if the solution here can help you:). Also check the table here, if you use the correct description of Play services API in the build.gradle – KENdi May 18 '16 at 10:44

1 Answers1

0

Always disconnect GoogleApiClient in onStop of your activity and reconnect in inStart. This might solve your problem.

 @Override
    public void onStop() {
        mgoogleApiClient.disconnect();
        super.onStop();
    }

    @Override
    public void onStart() {
        super.onStart();
        mgoogleApiClient.connect();
    }
NezSpencer
  • 640
  • 8
  • 12
  • I just double checked and I'm already doing this. I didn't have this problem using 8.3.0, just when I upgraded to 8.4.0 ! – unseen07 May 18 '16 at 08:59