com.google.android.gms.common.api.ApiException: 12500 ISSUE


I am getting this error when signing in with google using firebase in flutter. There is another similar question – already tried all answers none worked

Things I have done

  • Added a support email

  • Generated a sha1 and sha256 using the command

    keytool -list -v -keystore <keystore path>

  • Configured Oauth screen in google cloud – so added a support email there too and set email users to external

  • Using my actual phone as an emulator, so it does have google play installed

Images & Code

Oauth Screen:
enter image description here

Firebase Sha1
enter image description here

Code (shortened):

 final GoogleSignIn googleSignIn = GoogleSignIn();

      final GoogleSignInAccount? googleSignInAccount =
          await googleSignIn.signIn().catchError(
            (onError) => throw(onError)
          );

      if (googleSignInAccount != null) {
        final GoogleSignInAuthentication googleSignInAuthentication =
            await googleSignInAccount.authentication;

        final AuthCredential credential = GoogleAuthProvider.credential(
          accessToken: googleSignInAuthentication.accessToken,
          idToken: googleSignInAuthentication.idToken,
        );

        try {
          final UserCredential userCredential =
              await _auth.signInWithCredential(credential);
} on FirebaseAuthException catch (e) {
          if (e.code == 'account-exists-with-different-credential') {
            print('The account already exists with a different credential.');
          } else if (e.code == 'invalid-credential') {
            print('Error occurred while accessing credentials. Try again.');
          }
        } catch (e) {
          print(e);
        }

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img