This blog post is we’ll see how to get the SHA-1 fingerprint certificate in Android Studio. This will help the new Android developers to find the SHA-1 Key for their application development.
Why SHA-1 in required
This SHA-1 debug signing certificate is important if you android application uses Dynamic Links, Google Sign-in or phone number support in Auth. If firebase services are used in your application then it’s important to add the SHA-1 to firebase console. If you don’t want to user these Firebase services in your android applicaiton, then adding the SHA-1 certificate is optional.
Read: Authenticating Your Client with Google Services
Get SHA-1 from Android Studio
Generating SHA-1 certificate from the Android studio application is the easist way as it doesn’t require knowledge of using the command tools. One can simple get the SHA-1 key in few clicks in Android Studio. To generate SHA-1 fingerprint certificate for you application development do follow the below mentioned steps.
You can also visit the old post for more details How to generate Android studio SHA key
Method – 1
- Open your Android Studio Project
- Click Gradle Bar from the IDE, can be found in right side panel.
- Refresh the Gradle – Click Refresh from Gradle Bar, it will list the Gradle scripts of your android project.
- Select your project and click on the Tasks from the list
- Click on Android and select signingReport and double click to execute the script
- Now you can find your SHA-1 key from the Run Bar. It also list the MD5 in the Gradle console.
In case step 5 is not listing any list or scripts named signingReport under the Task or if Task lis not build list do following method to generate the SHA-1 fingerprint.
- Double click on Execute Gradle Task in the top of the Gradle bar. (See image for reference)
- It will open a window with gradle scripts.
- Now type signingReport in the window to find the gradle script.
- Select the signingReport script and click enter to execute the script.
- This action will display your SHA-1 fingerprint and MD5 in the Gradle console.
The above method is very useful when there is not task list created in the gradle bar. At the time you can find the signingreport script in this way and get your sha fingerprint certificate for your Android application development.
For more Android related post click here.