Skip to content

[google_sign_in] java.lang.NullPointerException: Attempt to read from field [...] on a null object reference #74308

@jakub-trzebiatowski

Description

@jakub-trzebiatowski

I found a following stack trace in my team's Crashlytics:

Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'io.flutter.plugin.common.MethodChannel$Result io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate$PendingOperation.result' on a null object reference
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.finishWithSuccess(GoogleSignInPlugin.java:2)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.onSignInAccount(GoogleSignInPlugin.java:69)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.onSignInResult(GoogleSignInPlugin.java:8)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate.access$000(GoogleSignInPlugin.java)
       at io.flutter.plugins.googlesignin.GoogleSignInPlugin$Delegate$1.onComplete(GoogleSignInPlugin.java:2)
       at com.google.android.gms.tasks.zzj.run(zzj.java:23)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at com.google.android.gms.internal.tasks.zzb.dispatchMessage(zzb.java)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:8167)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

One occurrence, app with ~1000 active users.

I had a quick look at the plugin's code in the location mentioned in the stack trace. result is passed through a few layers without a null-check. Maybe there's a reasonable (but rare) path when it actually can be null?

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: productionIssues experienced in live production appsc: crashStack traces logged to the consolec: fatal crashCrashes that terminate the processp: google_sign_inThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions