How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
Many Users has given their answers and it's working fine in Android Studio's version below 4.2. But for Android Studio 4.2 and newer version ,follows these steps to generate SHA Key . Steps are given in these pictures.
Steps:-
1) Click on the gradle. Top right on the Android Studio. As you can see in this picture.
2) Now click on icon as seen in below picture. A new searchable windows/screen will open.
3) Now type,gradle signingreport and press Enter to start generating SHA KEY as seen in below picture.
4) Your SHA Key will generate as seen in this picture. Using these steps you can generate SHA KEY in Android Studio 4.2.
Note:- If you are not able to get SHA key then follow instructions given in this answer.(FLUTTER/React Native ...)
Link:-SHA Key for flutter/react native
Easiest ways ever:
Update added for Android Studio V 2.2 in last step
There are two ways to do this.
1. Faster way:
- 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 (root))
- Click on Tasks
- Click on Android
- Double Click on signingReport (You will get SHA1 and MD5 in Run Bar(Sometimes it will be in Gradle Console))
- Select app module from module selection dropdown to run or debug your application
Check the screenshot below:
2. Work with Google Maps Activity:
- Open Android Studio
- Open Your Project
- Click on File menu -> Select New -> Click on Google -> Select Google Maps Activity
- A dialog would appear -> Click on Finish
- Android Studio would automatically generate an XML file named with
google_maps_api.xml
- You would get debug SHA1 key here (at line number 10 of the XML file)
Check Screenshot below:
Android Studio V 2.2 Update
There is an issue with Execution.
Solution:
- Click on Toggle tasks execution/text mode from Run bar
Check Screenshot below:
Done.
My problem is the same as I have also shifted my Google Maps project from Eclipse to Android Studio. I have solved my problem by following this:
Go to your Java bin directory via the command:
C:\Program Files\Java\jdk1.7.0_71\bin>
Now type in the below command in your command window (CMD.EXE):
keytool -list -v -keystore c:\users\your_user_name\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
Example:
keytool -list -v -keystore c:\users\James\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
Or you can just write this in cmd if you don't know the username:
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
And you will get the SHA1.
Then I created a new key from https://code.google.com/apis/console because of my package name got changed and then use this key in my application. It works fine.
Make sure you are in BIN folder of jdkX.X.X_XX (my folder name is jdk1.7.0_71), or else if you don't know what folder name you have then find it by opening the Java folder, and you will see what the folder name is, but you must be in your BIN folder and then run this command. Today I have got my SHA1 value in a cmd command window by the above procedure.
SNAPSHOT: