SHA-1 fingerprint of keystore certificate
Solution 1
Follow this tutorial for creating SHA1 fingerprint for Google Map v2
For Debug mode:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
for Release mode:
keytool -list -v -keystore {keystore_name} -alias {alias_name}
example:
keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test
On windows, when keytool command is not found, Go to your installed JDK Directory e.g.
<YourJDKPath>\Java\jdk1.8.0_231\bin\
, open command line and try the above commands for debug/release mode.
Another way of getting your SHA1 OR SHA-256 use ./gradlew signingReport
For more detailed info visit Using Gradle's Signing Report
Solution 2
If you are using android studio use simple step
- Run your project
- Click on Gradle menu
- Expand Gradle
Tasks
tree - Double click on
android
->signingReport
and see the magic - It will tell you everything on the Run tab
Result Under Run Tab If Android Studio < 2.2
From android studio 2.2
Result will be available under Run console but use highlighted toggle button
Or
Second Way is
Create new project in android studio New -> Google Maps Activity
then open google_maps_api.xml xml file as shown in pics you will see your SHA key
Solution 3
Easiest way for getting SHA1 Key in android studio both (Debug and release Mode)
- Open
Android Studio
- Open Your Project
- Click on Gradle (From Right Side Panel, you will see Gradle Bar)
- Click on Refresh (Click on Refresh from Gradle Bar , you will see List Gradle scripts of your Project)
- Click on Your Project (Your Project Name form List)
- Click on Tasks/Android
- Double Click on
signingReport
(You will getSHA1
andMD5
in Run Bar)
If you are using new Android Studio it shows time to execute on top there is Toggle task execution mode click on that you will get you SHA-1 key. Check 2nd and 3rd reference images.
Generate SHA-1 for Release Mode
1-First add keystore config in your gradle How to add config in gradle.
2-After Adding Config in gradle change build variant.
3-Then Follow Above Procedure you will get SHA-1 for release mode.
Solution 4
Go to your java bin directory via the cmd:
C:\Program Files\Java\jdk1.7.0_25\bin>
Now type in the below comand in your cmd:
keytool -list -v -keystore "c:\users\your_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Solution 5
If you are using eclipse, go to: Window->Preferences->Android->Build You will find what you are looking there.
user2208349
Updated on May 07, 2022Comments
-
user2208349 about 2 years
Is the method for getting an SHA-1 fingerprint the same as the method of getting the fingerprint? Previously, I was running this command:
It's not clear to me if the result I'm getting is the SHA-1 fingerprint. Can somebody clarify this?
-
Poras Bhardwaj over 8 yearsHope this link will help you. stackoverflow.com/questions/12214467/…
-
Naeem Ibrahim over 7 yearsEasiest way to Get SHA-1 For Release and Debug mode android studio gradle. Check this
-
Akhilesh Sinha over 6 yearsrun this command in your terminal: keytool -exportcert -list -v \ -alias androiddebugkey -keystore ~/.android/debug.keystore. It will ask for your keystore password. which you can find from the file named "debug.keystore.properties" in the android/keystore folder
-
KKSINGLA over 3 years
-
-
Jay Sidri over 9 years~/ is your home directory in *nix systems. Under Windows, just use %USERPROFILE%
-
Jay Sidri over 9 yearsIf you're writing Android apps on Xamarin, use this: keytool -list -v -keystore "%USERPROFILE%\AppData\Local\Xamarin\Mono for Android/debug.keystore" -alias androiddebugkey -storepass android -keypass android
-
ssj3goku878 over 9 yearsthis will do the job instead of going through the hassle of exporting and using CMD
-
Vincent over 8 yearsWorks great! I have included both a DEBUG and a RELEASE key in console.developer.google.com. Not sure if both are really needed. Nevertheless it works great, after spending 4 hours on this G**gle feature.
-
LairdPleng over 8 yearsMy 'gradle projects' window is empty... any ideas why that might be?
-
Lokesh Tiwari over 8 yearsIt will appear once you run the project either in emulator or on device
-
LairdPleng over 8 yearsYea I tried that but nothing happened. Seems as though, in my case, I had to press the 'refresh' button before anything showed up!
-
user207421 over 8 yearsNothing to do with certificates whatsoever.
-
danypata about 8 yearsFor all Android devs, this is quite an easy way to find the SHA1. Nice finding man.
-
Anwar Hossain almost 8 yearsis sha1 key same for all the apps? or different for every app?
-
Lokesh Tiwari almost 8 years@anwar Hossain Every time you generate SHA1 It can be different every time irrespective of app. I have tried two different days it has given me different
-
danypata almost 8 years@LokeshTiwari I think on Android Studio 2.1 the
signReport
task is inTasks -> android
-
عثمان غني almost 8 yearshow to get release sha1. I am getting it from my app.jks but console.google is showing its already used.
-
OneCricketeer almost 8 yearsHow is your answer different than those provided? stackoverflow.com/a/38369406/2308683
-
Lokesh Tiwari over 7 years@AdnanAli Thank you for pointing out. Yes it is available in 2.2 but use Toggle button in Run Console check updated pic
-
portfoliobuilder over 7 yearsWhere can I find the equivalent on Android Studio? My IDE is pointing to the wrong SHA1
-
portfoliobuilder over 7 yearsHow to change the location? I know how to change to a different keystore when signing, but what about the default one?
-
Maveňツ over 7 yearsplus 1 for toggle task execution/text mode :D
-
gpuser over 7 yearsAnother way you can get this certification detail for debug mode from (1)Right click on Gradle bar at android studio (2)then click on app -> Tasks -> android -> signingReports then on Gradle console you will get the reports
-
Irfan Raza over 7 yearsIt now appears under "Gradle Console" tab from Android studio 2.2.3
-
Shirish Herwade over 7 yearsvery detailed answer with images, helps a lot... very easy to understand than other answers here... up-vote for the images in answer
-
Napolean about 7 years$ keytool -list -v -keystore ~/.android/debug.keystore -storepass android only this also works
-
statosdotcom about 7 yearsAgree: best option. "Plused" one. I missed a l little bit more text information, but the main path you've shown. Thank you.
-
pblead26 about 7 yearsThe google Maps activity idea is the BEST. Thank you
-
Sushant Patekar almost 7 years1)You have to double click on the filename.
-
Shihab Uddin almost 7 yearsIf your alias key have space like "App Moon" then add double quation "App Moon" as alias name.
-
Lokesh Tiwari over 6 years@onexf go to build variants >> change debug to release
-
Himanshu arora over 6 yearsLook at this to get SHA-1 key using android studio. easybook4u.com/index.php/2017/08/25/…
-
ban-geoengineering over 6 yearsI've followed the steps in this answer and it works great. But how to change the Gradle setting back to whatever it was so that when I click the Run button in Android Studio, it installs and runs the app on my device/emulator as it did previously?
-
ban-geoengineering over 6 years...solution to my Run problem here: stackoverflow.com/a/48283047/1617737 .
-
Valentin Yuryev over 6 yearsIt's the best solution for Android Developers who work on Windows because keytool is not works in Windows console.
-
Ankur Shah almost 6 yearsdo you also know how to remove it?
-
Emil almost 6 yearsyour solution is working fine. why the heck, google official documentation doesnt work? coment defiined here wont execute and return error. developers.google.com/android/guides/client-auth
-
Harsha almost 6 yearsafter generating releasemode api key for sha1 for google places api for android place picker map opened and closed immediately.In log showing forbidden error 403 please help me
-
Harsha almost 6 yearshere showing 2 signin certificates appsignin and uploaded signincertificates.which one i need to use for release
-
Eaweb over 5 yearsWorks fine, thanks for this answer. However, I am curious if I can use this to get SHA1 for release key of my app. (the default is debug key)
-
Abhishek Mehandiratta over 5 yearsA true savior! I don't know why the SHA-1 key was different when generated from command prompt and android studio.
-
ParSa almost 5 yearsthe best and working solution , for google clientID i needed SHA-1 in release mode , other solutions give us the SHA-1 in debug mode
-
Sanket Patel over 4 yearsit shows sha1 for debug, is this same for release variant also ?
-
Oliver D over 4 years@SanketPatel are u got the release SHA1?
-
Oliver D over 4 yearsI do it but i dont got the SHA for release !
-
Jayakrishnan over 4 yearsPlease make sure you have added sign in credential in the sign in configuration under release block in gradle. Otherwise it wont show release sha key
-
Sanket Patel over 4 yearsnope, actually i resolved my issue so stopped searching for it @Oliver
-
Emzor about 4 yearsAfter battling with this issue for SEVERAL hours, your answer saved my app's life. THANKS!!!!
-
ßiansor Å. Ålmerol about 4 yearsFor release you need to use the App signing certificate
-
Jaichander about 4 yearsThanks,Saved my Day
-
MMG about 4 yearsGive example for debug please
-
Gilian Marques almost 4 yearsI just created a .bat for convenience: ??@echo off ??title SHA-1 from release keystore ??color 0a ??cd C:\Program Files\Android\Android Studio\jre ??set /p keystorePath= Set the path to the keystore here (just drag it here): ??set /p alias= Enter the keystore alias: ??echo : ??echo : ??echo : ??keytool -list -v -keystore %keystorePath% -alias %alias% ??echo : ??echo : ??echo : ??set /p cmd=Press any key to exit Create a .bat file, paste this code, replace the "??" by line breaks and change JRE path if needed.
-
Akshay Sahai almost 4 yearsScreenshots were quite helpful
-
greybeard over 3 yearsThere are archive snapshots of the tutorial referenced above.
-
mhdjazmati over 3 yearsyou are the boss!! :)
-
Kleber about 3 yearsJust for future reference: make sure you point to
~/.android/debug.keystore
file. As I already had a keystore file, I thought I should reference it or create a new one in order to make this command work properly. -
Vishal Beep almost 3 yearsthis is a very lengthy process.
-
Vishal Beep almost 3 yearsbro in the current version it will maybe not work.
-
Adnan haider over 2 yearsgot error missing keystore
-
Rahul Kushwaha over 2 years@Adnanhaider have you tried all steps carefully ? Its valid in latest version of android studio. If you are using old version then open gradle then app and then android and last click of signing report
-
Adnan haider over 2 yearsmy bad i used release config that's why i got error. now its work fine thanks
-
Braj about 2 yearsthanks I used password as "android" that solved this issue