Question

I am trying to make an app that can communicate with Google Cloud Messaging. I have looked at some tutorials and read a lot of stuff, but it all skips one point. When configuring an Android Key for API Project it asks for a SHA1 certificate fingerprint.

enter image description here

How do I find this (I have eclipse and windows 7)?

Any help would be appreciated.

Was it helpful?

Solution

Here is how to get it :
In Eclipse, if you go to Windows ->Preferences -> Android -> Build.

OTHER TIPS

enter image description here

You can get SHA1 from here using the steps and Keystore Password with be "android".

if you are working in android (Google drive apps, Google Map apps), and you need SHA1 or MD5 then follow this step to get your SHA1 and MD5.

  1. Open Eclipse
  2. Windows-->Preferences-->Android-->Build (Here you will got a path to your "debug.keystore" Copy this path.
  3. Find out where is your jdk (like in my system "C:\Program Files\java\jdk1.6\bin " Now open TERMINA(cmd) and change the directory to the bin , like c:\ cd "C:\Program Files\java\jdk1.6\bin"
  4. Now after that copy-paste this code in your terminal

keytool -list -v -keystore "C:\Users\pir fahim shah.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

you can change your "debug.keystore" file address here.

Some snapshot which will show my process Finding debug.keystore

Change directory to your jdk's bin Finding out SHA1 and MD5

Found debug keystore file on Mac with Android Studio at ~/.android/debug.keystore

keytool -list -v -keystore ~/.android/debug.keystore 
  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 (Your Project Name form List (root))
  6. Click on Tasks
  7. Click on android
  8. Double Click on signingReport (You will get SHA1 and MD5 in Run Bar)
  9. Check app run console bar

I found a very easy process to find you MD5, SHA-1 fingerprint using Android Studio.

  1. Run your project
  2. Go to Gradle Menu (Menu: View -> Tool Windows -> Gradle)
  3. Go to 'signingReport' in Gradle window. (Your project -> Tasks -> android -> signingReport)
  4. Run it. (Using double-click or Ctrl + Shift + F10)
  5. In Run window you will find all info.

The best solution for generating SHA1 key for android is from android studio.

Click on Gradle on far right side

Click on refresh icon and you will see the name of the app

Click on the Tasks -> Report -> Signing Report

Find the SHA1 Key on bottom part in console

  • For Debug Version of SHA1 key open terminal and enter the following command.

    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Note: If you find any error you may need to change path of your debug.keystore file(In my case it is "/.android/debug.keystore").

  • For Release Version of SHA1 key, first you need to generate signed apk. After that you will get .jks file. Then apply the following command in terminal.

    keytool -list -v -keystore ~/.android/release.jks -alias ProjectName

Note: If you find any error you may need to change path of your release.keystore file(In my case it is "/.android/release.keystore").

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top