skip to Main Content

I’m getting this error:

Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)`

There are a few things about this that make it I think potentially may be the issue. I have an existing app that I’m rewriting from scratch. The existing app has google sign in, and I’m using the same firebase account. Also, when I started writing the new app, I used the wrong package, so I changed the package name to the correct one. Originally, I was going to use a new firebase project, and was able to use google sign in with the different package and firebase account.

So, could this be related to the fact that another live app is using the firebase app?

I’ve confirmed I have done the following:

  • set the SHA1 and SHA256 in firebase
  • confirmed google sign in is enabled on firebase
  • run flutter clean, flutter doctor, invalidated caches and restart
  • have the same package name on app and on firebase
  • downloaded the new google-services.json

2

Answers


  1. Chosen as BEST ANSWER

    Just in case this helps someone, here's what finally helped me:

    final GoogleSignInAccount? googleUser = await GoogleSignIn(
            scopes: ['email', 'profile'],
            hostedDomain: '',
          ).signIn();
    

  2. I was facing the same issue, it was already working but suddenly it stopped, all I did was remove SHA1 and SHA256 in Firebase, update google_sign_in to the latest version, and then generate new SHA1 & SHA256, add these new keys in Firebase and worked.

    Generate SHA1 & SHA256

    You can also check this answer

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search