5

I have finished my application with flutter, but in release mode, firebase auth is not working. I've been told that I must generate a SHA1 for the release mode, but I don't know how. It works in debug mode, but not in release mode. How can I generate it, or do we have another solution?

KENdi
  • 7,205
  • 2
  • 14
  • 26
Pondikpa Tchabao
  • 1,853
  • 5
  • 13
  • 20

4 Answers4

9

You need to access the application in Play Store. In the section Release Management > App signing you can get the SHA1. Copy, put in the Firebase configuration, download the google-services.json and put in your app folder.

enter image description here

Ascension
  • 1,511
  • 1
  • 11
  • 12
  • Perfect answer! – Vidor Vistrom Feb 22 '19 at 16:39
  • This should be the accepted answer. I used the release SHA1 generated by gradlew and it worked with flutter run --release but once I built and uploaded the app bundle to Google Play it did not work. Only this solution worked for that. It is a good thing they don't mention this in the setup instructions for Flutterfire... – Andreas Toresäter Apr 09 '21 at 05:00
3

I know this is a very old question, but I am leaving this here for anyone else who wanders by.

My app also would not authenticate while running in release mode. After hours of trying various things. I found my solution:

Using the steps listed here: https://stackoverflow.com/a/34223470/10575896

  1. Open Android Studio
  2. Open your Project
  3. Click on Gradle (From Right Side Panel, you will see Gradle Bar)
  4. Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
  5. Click on Your Project (Your Project Name form List (root))
  6. Click on Tasks
  7. Click on Android
  8. Double Click on signingReport (You will get SHA1 and MD5 in Run Bar(Sometimes it will be in Gradle Console))

The console will print out the SHA keys for both debug and release. I had added the debug keys to firebase, but i had not added the release keys.

I simply added the SHA1 and SHA256 keys to firebase, and I was good to go.

Airborne Eagle
  • 183
  • 1
  • 10
0
  1. Navigate the below menu and Open your android module of your project in new window

Tools->Flutter->Open Android Module in Android Studio

  1. After opening your android module of your project, Click on Gradle (From Right Side Panel, you will see Gradle Bar, if not Navigate to View -> Tool Windows -> Gradle)

  2. Navigate to android->app->Tasks->android->signingReport. android->app->Tasks->android->signingReport Thats it get your reports in your bottom pannel

pmmadhura
  • 1
  • 4
0

I had this issue for weeks and found this as my solution:

ADD THE SHA FROM GOOGLE PLAY TO THE FINGERPRINT: You need to access the application in Play Store after release for the playstore. In Settings -> App signing by Google Play > you can get the MD5, SHA-1 and SHA-256. Copy the fingerprint in the App signing key certificate section, put in your Firebase configuration (Settings -> General -> Your Android App -> SHA certificate fingerprints -> add fingerprint), download the new google-services.json and put in your app folder.

New Google Play Console Screenshots to find your fingerprints: [New Google Play Console Menu Screenshot][1] [New Google Play Console Section Screenshot][2] [1]: https://i.stack.imgur.com/SBrDx.png [2]: https://i.stack.imgur.com/9Sq1Z.png

Tara H
  • 1
  • 1