Get SHA1 fingerprint certificate in Android Studio for Google Maps

93,519

Solution 1

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

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

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. How to obtain Signing certificate fingerprint (SHA1) for OAuth 2.0 on Android?

Solution 4

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

  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.

Share:
93,519
arslan haktic
Author by

arslan haktic

"Only 3 kinds of people are remembered in this world; First, Best &amp; Different." My life is a continuous struggle to fall in these 3 categories for all that i do! Passionate, determined, persuasive, hard-working, self-motivated, creative, restless and resilient are the words that describe me best. I am an Software Engineer with specialization in Mobile Development and over 3 years of professional experience in private sector. Working for the betterment of people and appreciating my team members to develop and perform at the best of their abilities is what has always motivated me in my career. I have helped leading in-house and international projects and products achieve their goals in my little but compelling experience spread across the management, planning, leading development, research &amp; application developments. I am currently leading various hoteling initiatives worth millions of dollars with a clientele spanning from restaurants and hotels like the Cappella, Hilton, Marriot, Auburn University Hotel and TRUMP Hotels. Some key projects being lead include the Magazine.nu, Kunstzone, Old Timer, UberGuest, Piano, Talking Yetti, Campus Handbook, Perfi8 and Fotki. I also co-founded TBoPedia; Emerging Technology Blog. I seek new challenges in the field of Mobile Development, where I can use my professional skills and experience of years, and help the organization to develop the culture of ethics, integrity and commitment, and prosper to achieve its mission. Specialities: ✔ 2.5 years creating and managing IT products, software development and team management including products for global markets ✔ 1.5 years working with international teams of mixed roles, seniority and skill sets. ✔ Knowledge of the core components and architecture of complex mobile application structures and services. ✔ Passion, desire and motivation to work in a start-up environment. ✔ Strong hands-on experience with software development, marketing, and analytical tools.

Updated on July 31, 2021

Comments

  • arslan haktic
    arslan haktic almost 3 years

    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.

  • arslan haktic
    arslan haktic almost 9 years
    Sorry But this didn't work its giving this error. keytool -list -v -keystore keystorename.keystore -alias aliasname keytool error: java.lang.Exception: Keystore file does not exist: keystorename.keystore java.lang.Exception: Keystore file does not exist: keystorename.keystore at sun.security.tools.keytool.Main.doCommands(Main.java:742) at sun.security.tools.keytool.Main.run(Main.java:340) at sun.security.tools.keytool.Main.main(Main.java:333)
  • sebastian
    sebastian almost 9 years
    Of course you have to change "kestorename.keystore" to the actualname of your keystore file. Same applies for the aliasname.
  • sebastian
    sebastian almost 9 years
    As i told you in my answer.
  • arslan haktic
    arslan haktic almost 9 years
    I got it, thanks, but what should be location of keystore file in my hard drive .. ?
  • Anees U
    Anees U over 8 years
    can you show the complete cmd path where you executing this command
  • arslan haktic
    arslan haktic over 8 years
    @AneesU I am writing above command on home directory when i open terminal.
  • ch3tanz
    ch3tanz about 8 years
    @Jai Yea this is the best and simple answer but how to do it for release version?
  • Jignesh Goyani
    Jignesh Goyani about 8 years
    Other way of file SHA1 key 1.Click on your package and choose New -> Google -> Google Maps Activity 2. Android Studio redirect you to google_maps_api.xml
  • mur7ay
    mur7ay almost 8 years
    OMG! I've been trying different tutorials for like two hours now. This saved me.
  • arslan haktic
    arslan haktic almost 8 years
    @mur7ay Thanks for your feedback