Skip to content

[firebase_auth] platform exception with firebase google_sign_in #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kroikie opened this issue Oct 13, 2019 · 4 comments
Closed

[firebase_auth] platform exception with firebase google_sign_in #534

kroikie opened this issue Oct 13, 2019 · 4 comments
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: auth type: documentation Improvements or additions to documentation

Comments

@kroikie
Copy link
Collaborator

kroikie commented Oct 13, 2019

Trying to sign in with google but always get this exception:
PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)

  • I have added SHA1 and SHA 256 to the project

  • I have enabled sign in with google in firebase console

  • I have updated version of google_services.json file

code to sign in:

Future<FirebaseUser> _incrementCounter() async {
   
     GoogleSignInAccount googleSignInAccount = await _googleSignIn.signIn();
     GoogleSignInAuthentication gsa = await googleSignInAccount.authentication;

     FirebaseUser user = await _auth.signInWithGoogle(
         idToken: gsa.idToken, accessToken: gsa.accessToken);

     print("user name: ${user.displayName}");
     return user;

 }

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17763.194], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    X Android license status unknown.
[√] Android Studio (version 3.2)
[!] Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    X android-studio-dir = C:\Program
    X Android Studio not found at C:\Program
[√] IntelliJ IDEA Community Edition (version 2018.2)
[√] VS Code, 64-bit edition (version 1.29.1)
[!] Connected device
    ! No devices available

@johnpryan
Copy link
Contributor

This issue was moved from flutter/flutter#25640 but I'm not sure it should be closed?

@inhumantsar
Copy link

Yeah I'm not sure this should be closed either... The docs don't reflect all the necessary steps, nor is there any documentation for the error numbers returned from the API.

If anyone ends up here looking for what's up, here's a summary of things to check:

  • OAuth consent page is filled in and correct (including logo and URLs)
  • Signing key config is correct. If you've changed build.gradle to use non-default release keys, then ensure you have a debug key configured as well. Either configure a separate debug key or re-use the release key config for the debug key (not ideal! only for tinkering!)
  • SHA1 hashes are in the right places
  • Application ID is set correctly in all relevant places. If you changed it in one of your AndroidManifest.xml files, make sure it's changed in all of them and that the OAuth and Firebase configs have the new one too.
  • Firebase config is correct and appropriate dependencies are in place
  • Google Play Services are up-to-date on any test devices you're using

@kroikie
Copy link
Collaborator Author

kroikie commented Oct 29, 2019

@johnpryan @inhumantsar thanks for calling this out.

@kroikie kroikie reopened this Oct 29, 2019
@iapicca iapicca added the type: bug Something isn't working label Nov 1, 2019
@helenaford helenaford changed the title platform exception with firebase google_sign_in [firebase_auth] platform exception with firebase google_sign_in Apr 22, 2020
@helenaford helenaford added plugin: auth type: documentation Improvements or additions to documentation impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) and removed type: bug Something isn't working labels Apr 22, 2020
@helenaford
Copy link
Contributor

helenaford commented Apr 22, 2020

Consolidating error handling for auth under #1456 - we'll be looking at parsing native error messages & codes and bubbling these up to the Dart layer in a consistent cross-platform format.
For documentation, consolidating under #728.

@firebase firebase locked and limited conversation to collaborators Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: auth type: documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants