Repository navigation
[google_sign_in] java.lang.NullPointerException: Attempt to read from field [...] on a null object reference #74308
Copy link
Copy link
Closed
flutter/packages
#9267Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: productionIssues experienced in live production appsIssues experienced in live production appsc: crashStack traces logged to the consoleStack traces logged to the consolec: fatal crashCrashes that terminate the processCrashes that terminate the processp: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: productionIssues experienced in live production appsIssues experienced in live production appsc: crashStack traces logged to the consoleStack traces logged to the consolec: fatal crashCrashes that terminate the processCrashes that terminate the processp: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
TahaTesser commentedon Jan 20, 2021
Hi @cubuspl42
Can you please provide your
flutter doctor -vandpubpsec.yamlThank you
jakub-trzebiatowski commentedon Jan 20, 2021
SaavyGirl commentedon Jan 20, 2021
TahaTesser commentedon Jan 21, 2021
Hi @cubuspl42
You seem to be using an old version of google_sign_in and an older Flutter
stablechannel.Please upgrade your
google_sign_inandflutterchannel to the latest stable releases.flutter channel stableflutter upgrade --forceflutter doctor -vIf the problem persists, provide the UPDATED
futter doctor -vandpubspec.yaml.Thank you
jakub-trzebiatowski commentedon Jan 25, 2021
Latest non-prerelease version of google_sign_in: 4.5.9
My version from
pubspec.lock:...so it's the newest.
Please note that the stack trace comes from production, from Crashlytics. It's a fatal crash. The production build is built on CI/CD, with a relatively new Flutter framework version. So my local
flutter doctoroutput doesn't matter. But anyway, I really don't think that a non-ancient Flutter framework can be responsible for aNullPointerExceptioninsideio.flutter.plugins.googlesignin.GoogleSignInPlugin!jakub-trzebiatowski commentedon Jan 25, 2021
I just confirmed that my team uses Flutter 1.22.5 on CI/CD.
9 remaining items
[google_sign_in] Redesign API for current identity SDKs (flutter#9267)
[google_sign_in] Redesign API for current identity SDKs (flutter#9267)
github-actions commentedon Jul 8, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[google_sign_in] Redesign API for current identity SDKs (flutter#9267)
[google_sign_in] Redesign API for current identity SDKs (flutter#9267)
[google_sign_in] Redesign API for current identity SDKs (flutter#9267)