1

I've been trying to fix this for a while now but I can't solve it. When I use the google_sign_in plugin, I'm able to choose my account but it stops after that.

SignIn

But after clicking... After

Giving me this error(the same) when I click continue:

E/flutter (28971): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

Things I've done:

  • I've searched for hours the error, the ApiException: 10, in Flutter and in Android in general.
  • Adding a SHA1 key, I've followed multiple tutorials (each one is different one to another, which is really confusing).
  • Downloaded the new JSON file.
  • Flutter clean.
  • Contemplated not using it.
  • Asking here.

Right now I'm using:

  • firebase_auth: ^0.11.1
  • google_sign_in: ^4.0.1+3

The app is in debug mode. I don't have an account to publish in the Google Store.

Thank you in advance.

Udara Abeythilake
  • 1,215
  • 1
  • 20
  • 31
Nauzet
  • 163
  • 3
  • 11

2 Answers2

1

You must register your fingerprint debug.keystore in firebase, you probably only registered an release.keystore:

show debug.keystore (linux):

keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore

source: documentation

Igmer Rodriguez
  • 164
  • 4
  • 18
1

If you are using Internal App Sharing to test Flutter builds on actual Android devices (like I am), there is another App Signing certificate fingerprint you need to add.

Find it using the left navigation of Google Play Console go to: Developer Tools -> Internal App Sharing

Select the App Certificate tab. Should look something like this:

Google Play - Internal App Sharing - Certificate

Copy the SHA1 key for your Internal test certificate and add it to the Firebase Console -> Project Settings -> [your Android app] -> SHA certificate fingerprints (use the button to Add fingerprint)

Download your updated google-services.json and update/add it in your android/app folder of your project.

This works with new users and existing users. I built the an appbundle (not APK) using flutter build appbundle

The above solution isn't documented anywhere by Google and I have not seen this solution elsewhere in the Flutter community. I came across this solution while poking around in the Google Play console after trying dozens of "fixes" that didn't work.

elliott-io
  • 1,394
  • 6
  • 9
  • 1
    Thanks bro, you saved my day, otherwise definitely, I had to do lifetime R&D for same. This is what I was looking for. – Imran Samed Jul 17 '20 at 08:16