Google maps - How to get the SHA-1 fingerprint certificate in Android Studio for debug mode

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

https://en.wikipedia.org/wiki/Android_Studio https://en.wikipedia.org/wiki/Android_Studio

http://developer.android.com/tools/publishing/app-signing.html http://developer.android.com/tools/publishing/app-signing.html

Android Studio signs your app in debug mode automatically when you run or debug your project from the IDE.

http://pongodev.com/get-sha1-for-debug/ http://pongodev.com/get-sha1-for-debug/

keytool -list -v -keystore "%USERPROFILE%.androiddebug.keystore" -alias androiddebugkey -storepass android -keypass android

Is there a way to find the SHA-1 fingerprint from Android Studio like it was very easy in Eclipse? As I am newbie in Android Studio, what is the full process to find it?

Another thing I want to add is that I have my Eclipse generates the SHA-1 fingerprint and previously I have my app registered on that fingerprint in Google developer console, and I worked on that app in Eclipse by that API key. Is the same API key can be worked on this my project in Android Studio?

Answers

  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 )
  Check the screenshot below:   

https://i.stack.imgur.com/GUFbd.png https://i.stack.imgur.com/GUFbd.png

  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:   

https://i.stack.imgur.com/u4Ppn.png https://i.stack.imgur.com/u4Ppn.png

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:   

https://i.stack.imgur.com/UG1vW.png https://i.stack.imgur.com/UG1vW.png

  Done.   

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/27609442/how-to-get-the-sha-1-fingerprint-certificate-in-android-studio-for-debug-mode

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils