Get SHA1 fingerprint certificate in Android Studio for Google Maps

AndroidMacosGoogle MapsSha1

Android 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

enter image description here

Solution 3 - Android

All above answers are correct.

But,Easiest and Faster way is below:

  1. Open Android Studio

  2. Open Your Project

  3. Click on Gradle (From Right Side Panel, you will see Gradle Bar)

  4. Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)

  5. Click on Your Project Name like MyProject(root)

  6. Click on Tasks

  7. Click on android

  8. Double Click on signingReport

  9. Wait for few seconds and you will get SHA1 and MD5 in Console Bar

enter image description here

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: enter image description here (top left of > the error log) and you will get your SHA1 key.

Solution 5 - Android

  1. Go to your key directory / Folder.
  2. Use following command in the terminal: keytool -list -v -keystore <yourKeyFileName.withExtension> -alias <yourKeyAlias>.
  3. 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

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

enter image description here

> Step 3) Click on signingReport and see the magic

enter image description here

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionarslan hakticView Question on Stackoverflow
Solution 1 - Androidarslan hakticView Answer on Stackoverflow
Solution 2 - AndroidJignesh GoyaniView Answer on Stackoverflow
Solution 3 - AndroidPoras BhardwajView Answer on Stackoverflow
Solution 4 - AndroidSneha PatelView Answer on Stackoverflow
Solution 5 - AndroidsebastianView Answer on Stackoverflow
Solution 6 - AndroidRod_AlgonquinView Answer on Stackoverflow
Solution 7 - AndroidAbdul Rahman MajeedView Answer on Stackoverflow
Solution 8 - AndroidTigress_ TamannahView Answer on Stackoverflow
Solution 9 - AndroidUzairView Answer on Stackoverflow
Solution 10 - AndroidQuick learnerView Answer on Stackoverflow
Solution 11 - AndroidSaurav KumarView Answer on Stackoverflow