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

You won't find a gradle window view in flutter project, so here is a solution for that.. In command prompt navigate to bin folder of jdk and run this command

keytool -list -v -keystore "C:\Users\yourusernamehere\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

change user name in path


I partially agree with Rishab answer, but what we can do is

and this approach works with all flutter/React-native/Android ....

Navigate to Android folder inside project, there is gradlew file. so we can use this like :

gradlew signingReport 

in Mac

./gradlew signingReport

in my case i use it like :

D:\flutter\flutter_app\android>gradlew signingReport

Project Architecture is :

enter image description here


This is the easiest way-

  1. Open Android Studio

  2. Open Project

  3. Reveal android folder

  4. Right click "gradlew" file and select Open in Terminal -

Open in Terminal

  1. Go to the terminal view and paste: gradlew signingReport

(edit based on Venkat D. suggestion below: on unix-based systems like mac, you need to specify the current directory like this- ./gradlew signingReport)

Paste

  1. Press enter and scroll to "Variant: debug" to get the SHA1 key

Scroll to key

  1. Copy and use wherever you need it, Good Luck!

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