Crash inside GoogleSignInAccount in latest PlayServices 8.3

混江龙づ霸主 提交于 2019-12-03 15:43:30

问题


The latest release on play services (8.3) has an issue related to GoogleSignInAccount.

We received a crash generated from it. Here it is the stacktrace.

Android: 4.4.4
Manufacturer: Sony
Model: D5503
Date: Thu Nov 12 16:36:06 GMT-08:00 2015

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=40962, result=-1, data=Intent { (has extras) }} to activity {com.spreaker.android/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: java.lang.NullPointerException
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3455)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3498)
    at android.app.ActivityThread.access$1300(ActivityThread.java:144)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:212)
    at android.app.ActivityThread.main(ActivityThread.java:5135)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
    at java.util.Collections.sort(Collections.java:1882)
    at com.google.android.gms.auth.api.signin.GoogleSignInAccount.zzms(Unknown Source)
    at com.google.android.gms.auth.api.signin.GoogleSignInAccount.zzmx(Unknown Source)
    at com.google.android.gms.auth.api.signin.internal.zzn.zza(Unknown Source)
    at com.google.android.gms.auth.api.signin.internal.zzn.zzb(Unknown Source)
    at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.zza(Unknown Source)
    at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onActivityResult(Unknown Source)
    at android.app.Activity.dispatchActivityResult(Activity.java:5423)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:3451)
    ... 11 more

Checking the app logs on our side, could be related to some connectivity issue but I could be wrong.

Any help with this is appreciated. Thanks

EDIT: Upon request, this is how we build the GoogleApiClient (and required options)

    GoogleSignInOptions.Builder gsoBuilder = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestScopes(
                    new Scope("profile"),
                    new Scope("email"),
                    new Scope("https://www.googleapis.com/auth/plus.me")
            )
            .requestProfile()
            .requestServerAuthCode(this._config.getGoogleClientId(), true);

    this._googleApi = new GoogleApiClient.Builder(getActivity())
            .enableAutoManage(getActivity(), new OnConnectionErrorListener())
            .addApi(Auth.GOOGLE_SIGN_IN_API, gsoBuilder.build())
            .build();

回答1:


Do you have added GET_ACCOUNTS permission?



来源:https://stackoverflow.com/questions/33689689/crash-inside-googlesigninaccount-in-latest-playservices-8-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!