Generate SHA-1 for Flutter/React-Native/Android-Native app
How to get Release and Debug keys: one more the easiest way (May 2019). All actions are inside Android Studio.
- Select android/app/build.gradle file and on the right top corner click "Open for Editing in Android Studio"
- Open Gradle panel and double click on "SigninReport",
see Android studio Gradle Tab
- 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.
TERMINAL - another way with the terminal. In case you can't find the "Open for editing .." link.
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
This is the easiest way-
-
Open Android Studio
-
Open Project
-
Reveal android folder
-
Right click "gradlew" file and select Open in Terminal -
- 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)
- Press enter and scroll to "Variant: debug" to get the SHA1 key
- Copy and use wherever you need it, Good Luck!
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