Search code examples
androidfluttergoogle-cloud-platformgoogle-oauth

Flutter Android Google Sign-in error: ApiException: 10 after confirming package name, SHA-1 fingerprints, and setting up consent page


I am trying to use Google Sign-in in my Flutter app, but I am receiving the following error message, even after waiting 24 hours after adding my SHA-1 fingerprint to the Google Play Console (Im not using firebase), confirming the package name, adding both debug and release SHA-1 fingerprints, and setting up the consent page:

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

Additional information:

  1. I am using the latest version of the Google Play services SDK.
  2. I have tried clearing my app's data and cache.
  3. I have tried uninstalling and reinstalling my app.
  4. I have tried running the app in release mode.
  5. I have tried testing the app on a different device.

Expected behavior:

I should be able to sign in with Google Sign-in without receiving any errors.

Actual behavior:

I am receiving the error message PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null).

Steps to reproduce:

  • Add your SHA-1 fingerprint to the Google Play Console.
  • Wait 24 hours.
  • Confirm that the package name in your Flutter app is identical to the package name in the Google Play Console.
  • Add both the debug and release SHA-1 fingerprints to the Google Play Console. Set up the consent page.
  • Try to use Google Sign-in in your Flutter app.

Expected result:

You should be able to sign in with Google Sign-in without receiving any errors.

Actual result:

You will receive the error message PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null).

Update

  • the web sign in works fine.
  • mobile sign works fine when I use firebase Auth sdk instead of google_sign_in

Solution

  • The issue while debugging and trying to fix my issue I delete the google OAuth credentials and create new ones and I was using the old client id inside google sign in package

    my two advices are

    • wait for some time after creating your OAuth credentials
    • do not use clint id for the fits time you test the sign in functionality or make sure it's the same for the current platform and the current SHA1