Generate SHA-1 for Flutter/React-Native/Android-Native app

Issue

I’m trying to generate a SHA-1 for a Flutter app, for Android studio to support Google Sign in, but I don’t know how to do that, I saw some posts that indicate to run a command, but there I need a jks file I guess, and flutter doesn’t create that.

Could someone help me?

Solution

TERMINAL

Go to the project folder in the terminal.

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

Windows
keytool -list -v -keystore "\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

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

GUI Android Studio.

  1. Select android/app/build.gradle file and on the right top corner click "Open for Editing in Android Studio"

enter image description here

  1. Open Gradle panel and double click on "SigninReport",

see Android studio Gradle Tab

enter image description here

  1. That’s it! If you use Firebase – add these 2 keys there. You should add both keys, otherwise, without the release key, Google login will not work on the devices.

enter image description here

Answered By – awaik

Answer Checked By – Pedro (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.