1

I'm writing a Flutter Android app using Firebase auth.

I'm having a sign_in_failed error. I know it's because I need to add the SHA fingerprints in the Firebase console.

I was able to generate the keystore for debugging. But I have no idea how to associate this debug keystore with the Android project.

How to define which debug keystore an Android app should use?

Andre Pena
  • 56,650
  • 48
  • 196
  • 243
  • 1
    You will already have a debug keystore (Android Studio generates one automatically) for your apps just run : `./gradlew signingReport` on the command line in the project root. It will display all signing keys including the SHA for the current debug keystore which is used to sign debug apps. Just copy that debug SHA into Firebase console (at some point you can create a release key, but even then if you use Google play signing you'd use the SHA from their signing key for release apps). https://stackoverflow.com/a/54324221/4252352 – Mark Sep 15 '22 at 23:07
  • @Mark I really appreciate your answer. It looks like you are correct, but I can only verify it tomorrow morning. If you would like.. feel free to add that as an asnwer and I will accept it if it works :) – Andre Pena Sep 15 '22 at 23:11
  • Glad it solved the issue, I've added an answer, which should be more comprehensive if others have the same issue. – Mark Sep 16 '22 at 10:10

1 Answers1

1

You will already have a debug keystore (Android Studio generates one automatically) for your apps.

Just run ./gradlew signingReport on the command line in the android project root.

This will display all signing keys including the SHA for the current debug keystore which is used to sign debug apps. Just copy that debug SHA into the Firebase console, which is located at:

Project -> Top Left Cog -> Project Settings -> General -> Your Apps -> Android Apps -> Your App -> Add Fingerprint

At some point you can create a release key and do the same procedure (making sure you build the apk using that release keystore - setup in the app build.gradle file under signing configs - more info here : https://developer.android.com/studio/publish/app-signing#sign-auto), however if you use Google play signing for your distributed apps you'd use the SHA from their signing key which is available within the Play Console at :

All Apps -> Your App -> Setup -> App Integrity -> App Signing

Mark
  • 9,604
  • 5
  • 36
  • 64