Problems getting MD5 fingerprint - android

I try to generate a MD5 fingerprint to obtain a map api key using Java7.
I do it on the way, described at developer page
"C:\Program Files\Java\jdk1.7.0\bin\keytool" -list -alias androiddebugkey -keystore C:\Users\username\.android\debug.keystore -storepass android -keypass android
The problem is, I'm getting SHA1 Fingerprint and not MD5
androiddebugkey, 01.08.2011, PrivateKeyEntry,
Certificate fingerprint (SHA1): xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Any ideas why?
Thnak you in advance

Interesting. Well, you can get the entire cert information using this command.
keytool -list -v -keystore C:\Users\username\.android\debug.keystore
You'll need to enter android as the password when prompted. That will give you everything in the keystore, which should only be one certificate rather than looking for a specific alias. It should show you both an MD5 and a SHA1 fingerprint. Give that a try and let me know.
The only thing I can think of is that jdk1.7's keytool gets information differently than jdk1.6(returns SHA1 by default?). This is just a guess and has not been verified but it is the only thing I can really think of.
Edit: It appears my guess might be correct. JDK 7 changes keytool output

Ok. I solved the problem with this answer
I changed my call to "C:\Program Files\Java\jre6\bin\keytool" and ... everything works

Related

Android Map Certifivate Fingerprint. (MD5):

So I am trying to do a map application on android.
I wrote this code on my mac os terminal to create Certificate fingerprint
keytool -list -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android
code generate:
(MD5): C9:C1:40:66:40:07:D0:8C:FF:44:A3:7D:F4:73:57:4B
I don't know why but code generate MD5 not SHA-1
and I understand I need 20 character finger print but my terminal generated 16 character.
if my fingerprint is wrong how can I create true one. If its true than how can I create Api key for map from developer.google.com
If do you have any clue please help. Thanks
Add -v in the end of the keytool command that you gave. It might look something like this.
keytool -list -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android -v
UPDATE:
I answered somewhat related problem like this before, you might get an idea from it if my answer is not enough for you. :)
How to/Error in declaring google-play-services-component
Install plug in eclipse
http://keytool.sourceforge.net/update
Go to eclipse -> Help -> Install new software paste above link
and install it
and then open keytool in ecipse open keystore option will be provided
it will give you SHA1 finger print.
(keytool window will be opened beside errorlog and logcat
click drop down and then androiddebugkey click it you will have all the info there)

Obtaining Google Maps API key

I'm using Windows 7.
I have tried several times with the debug.keystore with appears in c:\users\YOURUSER.android\ using the command:
keytool -list -alias androiddebugkey -keystore c:\Users\YOURUSER\.android\debug.keystore -storepass android -keypass android
It gives me a MD5, but then I go to Google MD5 registration page and it sais it is not a valid fingerprint.
I searched for more information, and I finally created a new debug.keystore into c:\users\YOURUSER\ to avoid rewriting the original one. I used this command:
keytool -genkey -keypass android -keystore c:\users\YOURUSER\debug.keystore -alias androiddebugkey -storepass android -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
It works, so I use the previous command to get the MD5, and it gives me a new MD5. Then I go to Google again and the same problem: "not a valid fingerprint".
The I made a second attempt. This is what I did then:
1) Opened a Windows7 terminal, went to c:\program files\java\jdk1.7.0\bin\
2) Wrote command:
keytool -genkey -v -keystore c:\eclipse\my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
3) Then I tried to get the MD5 code from my keystore, using comand:
keytool -list -alias alias_name -keystore c:\eclipse\my-release-key.keystore
and writing the password I am asked. It gives me a MD5.
4) I go to maps api key sign up and write the MD5. "FINGERPRINT NOT VALID"
I don't know what the problem is. And I am supposed to do this for every app I program? What a headache!
Can anybody help me please?
Are you sure you get the MD5 and not the SHA1 fingerprint? Tryed the -v option?
see: How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
google maps has deprecated its previous version API v1 and introduced a new version of google maps API v2.
previously we generated md5 key but now we need to generate sha-1 fingerprint certificate.
The Maps API key is based on a short form of your application's digital certificate, known as its SHA-1 fingerprint. The fingerprint is a unique text string generated from the commonly-used SHA-1 hashing algorithm. Because the fingerprint is itself unique, Google Maps uses it as a way to identify your application.
please go through the links it could help you
https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key
https://developers.google.com/maps/documentation/android/intro#sample_code
also see the same kind of post in stack over flow
How to implement Google Maps new version of API v2
In command line you need to open Java-> jdk-> bin
as for me it is "C:\Program Files\Java\jdk1.7.0_03\bin"
There is "keytool" program which u need. In command line enter "cd C:\Program Files\Java\jdk1.7.0_03\bin"
And enter "keytool -list -v -keystore C:\Users\John\.android\debug.keystore"
So the final string in command line must look like:
"C:\Program Files\Java\jdk1.7.0_03\bin>keytool -list -v -keystore C:\Users\John\.android\debug.keystore". Whare usually u need only to change the name "John"
There will be SHA-1, MD5, etc
Finally, go to Google Access API google access api

Android MD5 debug fingerprint missing from debug keystore

I have built a new development machine and installed Android SDK. I tried to obtain the Android MD5 debug fingerprint but cannot seem to get it to generate. I have deleted the debug.keystore to create a new one and only the SHA1 fingerprint is present.
Please advise
Here is my debug.keystore contents:
c:>"C:\Program Files\Java\jdk1.7.0\bin\keytool" -list -keystore "C:\users\me\.android\debug.keystore
Enter keystore password:
******* WARNING WARNING WARNING *******
* The integrity of the information stored in your keystore *
* has NOT been verified! In order to verify its integrity, *
* you must provide your keystore password. *
******* WARNING WARNING WARNING *******
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
androiddebugkey, May 2, 2011, PrivateKeyEntry,
Certificate fingerprint (SHA1): F8:A5:0E:DD:61:5D:FC:86:D9:33:13:48:30:E0:EF:37:
47:81:60:EF
c:>
I am running Windows7 64 bit. The MD5 fingerprints are also not showing in my production keystore that I restored from a backup from the previous system (WindowsXP SP3).
Follow these steps:-
c:>cd "C:\Program Files\Java\jdk1.6.0\bin>keytool" -list -keystore "C:\users\me.android\debug.keystore"
*note :- Replace me with your username
after this you get MD5 ,
Copy that MD5 paste it in https://developers.google.com/maps/documentation/android/v1/maps-api-signup
and generate API KEY for map, use that API KEY in main.xml file.
May it helps you.
Reply if not works
Your command yhould be for the debug certificate :
"C:\Program Files\Java\jdk1.7.0\bin\keytool" -list -alias androiddebugkey -keystore "C:\users\me\.android\debug.keystore" -storepass android -keypass android
(from : http://code.google.com/android/add-ons/google-apis/mapkey.html)
I found the answer. There is another post on SO (Link) that states that rolling back from
jdk-7-ea-bin-b140-windows-x64
to
jdk-6u25-windows-x64
resolves the issue. THIS WORKED FOR ME!
dranfi, your answer is technically correct, but that's what I used in the first place.
jdk-7-ea-bin-b140-windows-x64 obviously has some issues to resolve.
I perhaps should have stated the javaSDK version in the first place -sorry!
Java 7 (1.7.0) changed the default output from the keytool command. See JDK 7 changes keytool output .
Add the -v option to print all possible fingerprints, so complete command will look like this, then select the MD5 output:
keytool -v -list -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android

To Display the Google map on the emmulator

Now I am working on the Google maps API. I am not able to display the map on the emulator as well as the device......... how can i dis play the map.
I tried like this but i failed...
I searched for the debug.keystore in c:/ i found it.
I got Keytool.exe from the "C:\Program Files\Java\<JDK_version_number>\bin".
Opened the commend prompt and went to the above folder.
After that i copied this
"keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android"
and pressed enter then I got the Google api key **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
I pasted the key in this site http://code.google.com/android/maps-api-signup.html.
but the map is not generated it is saying that
fingerprint you entered is not valid. Please press the Back button on your browser and enter a valid certificate fingerprint.
What i need to do now to get the Map API key.
Okay, I was able to solve the problem in my case. I've got Java 7 on my machine and when I followed all the instructions as they are, I've got a SHA1 fingerprint, not MD5. I tried to use it to get the key and received exactly the error message from which this thread has started.
If you are having the same problem, just add the -v option (verbose output) after -list. keytool will then give you the MD5 fingerprint as well - use it.
keytool -list -v -alias androiddebugkey -keystore C:\Users\<user>\.android\debug.keystore -storepass android -keypass android
I will try to let Android folks know that they need to update the page with instructions.
for JDK 1.7 you get SHA1 fingerprint by default. But for generating Google Map API key you need fingerprint of MD5.
For more details navigate through the below link.
How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
Ok, so what you're supposed to enter in the link you posted is the MD5 fingerprint of your android SDK debug certificate. To get this you navigate here
Windows Vista: C:\Users\.android\debug.keystore
Windows XP: C:\Documents and Settings\.android\debug.keystore
and then enter
keytool.exe -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android
What you're currently doing is navigating to your Java folder and trying to find the fingerprint for your android SDK debug certificate there. It isn't located in that folder and hence you end up with a blank fingerprint ::*:::*:::*:::*:::*:*
You need to find the .android folder.
have you checked the path you use? I mean "C:\android\debug.keystore", Does the file there?
have you compared your fingerprint (the result of keytool.exe calling) with the example on http://code.google.com/android/maps-api-signup.html page? they must be very similar, maybe you just copied not the whole fingerprint from the cmd
Here is the simplest way to generate MD5 signature.
Find the folder .android which contains debug,keystore(usually it is located in c:\Documents and Settings\"User Name".android
Oepn command prompt and go to the keytool folder that you mentioned.
Now use following easy command to key MD5 fingerprint.
keytool -list -keystore "c:\Documents and Settings\"User Name".android\debug.keystore"
press Enter. It will ask you for password again press enter.
Enter the generated key in Google API registration page.
Use this key in your MapView.
I too had the same problem but got fixed...the problem might be you.. might have not given default location for emulator..i will get u the proper way to get the map in emulator...
1)to generate the hash key
http://code.google.com/android/add-ons/google-apis/mapkey.html
2)to set the default location
http://www.vogella.de/articles/AndroidLocationAPI/article.html#device_installation
hope it works fine..

generating google api key in android

I am developing an android application which involves google map activity.I have done all the coding part.Now want to generate the google api key for my system.Can anybody help in this regard.Thanks in advance
Tushar Sahni
Everything you need to know is explained in the documentation. Copying from there:
Run this command to generate a certificate:
$ keytool -list -alias alias_name -keystore my-release-key.keystore
(Rename alias_name and my-release-key.keystore to something meaningful)
The result from the above command will be something like this:
Certificate fingerprint (MD5): 94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98
Then go to http://code.google. com/android/maps-api-signup.html and follow the instructions to register your certificate.

Categories

Resources