Get SHA1 fingerprint certificate in Android Studio for Google Maps
AndroidMacosGoogle MapsSha1Android Problem Overview
I want to get the SHA1 key from Android Studio on a Mac. From Eclipse it's simple, but I can't get this in Android Studio.
I have checked similar questions but didn't get any way to get that in MAC.
The SHA1 is different for signed and unsigned APK. Please mention the methods to get for both.
Thanks in advance.
Android Solutions
Solution 1 - Android
I got my Answer, it was quit simple. Open Terminal, Type command:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Press Enter: You will get the following info, and SHA1 can be seen there.
.....
Certificate fingerprints:
MD5: 79:F5:59:................FE:09:D1:EC
SHA1: 33:57:0A:C9:..................:91:47:14:CD
SHA256: 39:AA:23:88:D6:...................33:DF:61:24:CB:17:47:EA:39:94:99
.......
Solution 2 - Android
Very easy and simply finding the SHA1 key for certificate in only android studio.
You can use below steps:
A.Open Android Studio
B.Open Your Project
C.Click on Gradle (From Right Side Panel, you will see Gradle Bar)
D.Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
E.Click on Your Project (Your Project Name form List (root))
F.Click on Tasks
G.Click on android
H.Double Click on signingReport (You will get SHA1 and MD5 in Run Bar)
OR
1.Click on your package and choose New -> Google -> Google Maps Activity
2.Android Studio redirect you to google_maps_api.xml
Solution 3 - Android
All above answers are correct.
But,Easiest and Faster way is below:
-
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 Name like MyProject(root)
-
Click on Tasks
-
Click on android
-
Double Click on signingReport
-
Wait for few seconds and you will get SHA1 and MD5 in Console Bar
If you are adding a MapActivity in your project than see this answer for SHA1. https://stackoverflow.com/questions/12214467/how-to-obtain-signing-certificate-fingerprint-sha1-for-oauth-2-0-on-android/32558627#32558627
Solution 4 - Android
Follow the below steps to get SHA1 fingerprint Certificate in Android Studio in 2.2v.
> 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 signing-report (You will get SHA1 and MD5 in Run Bar) > Then click this button: (top left of > the error log) and you will get your SHA1 key.
Solution 5 - Android
- Go to your key directory / Folder.
- Use following command in the terminal:
keytool -list -v -keystore <yourKeyFileName.withExtension> -alias <yourKeyAlias>
. - Enter Key Password entered at time of key creations.
yourKeyAlias had given at time of creation of your key.
Solution 6 - Android
The other way to get the SHA1 fingerprint instead of inputting a keytool
command is to create dummy project and select the Google Map Activity
in the Add an activity module
and after the project is created you then open the values->google_maps_api.xml
in that xml you'll see the SHA1 fingerprint of your android studio.
Solution 7 - Android
There is no way in Android Studio
like Eclipse
Windows -> Preferences -> Android -> Build.
Android Studio
signs your app in debug mode automatically when you run or debug your project from the IDE.
You may get using the following Command!!
keytool -list -v -keystore ~/.android/debug.keystore
Solution 8 - Android
Type this is the Terminal
keytool -list -v -keystore ~/.android/debug.keystore
It will ask you to enter the password
enter 'android'
Then you would get the details like the SHA1.
Solution 9 - Android
After clicking signingReport You will get SHA-1 finger certificate for your application
I am here if you need any other help
Solution 10 - Android
FOR PRODUCTION BUILD / LIVE BUILD sha key follow these steps
> Step 1 ) Add release details in gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "app.devdeeds.com.yourapplication"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
//Signing configurations for build variants "release"
signingConfigs {
release {
storeFile file("F:/Development/myapp.jks")
storePassword "231232das"
keyAlias "myapp_rel"
keyPassword "dasd333_das"
}
}
buildTypes {
//link above defined configuration to "release" build type
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
}
> Step 2) open gradle menu from right menu bar and then app > android > > signingReport
> Step 3) Click on signingReport and see the magic
Solution 11 - Android
If you don't get tasks in gradle then you can simply select the gradle icon and then write: signingreport and you will get all the sha codes enter image description here