4

I'm trying to generate the MD5 fingerprint from the debug.keystore file using keytool.exe in my JDK so I can use Google Maps in my Android project. I've located the keystore file and have moved it into C:\android just to make things easier.

Then in a command prompt I type

c:\Program Files\Java\jdk1.5.0_13\bin>keytool -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android

And I keep getting the error:

keytool error: java.lang.Exception: Keystore file does not exist: C:\android\debug.keystore

I've also tried entering the keystore in from its original location rather than moving to c:\android but I still get the same error.

Does anyone have any idea why this is happening? Also, is there any other way to get this MD5 fingerprint? Some program maybe?

Jason Plank
  • 2,336
  • 5
  • 31
  • 40
Capsud
  • 609
  • 4
  • 8
  • 16

8 Answers8

8

to generate debug.keystore file

in Eclipse/ADT, go to Windows > Preferences > Android > Build

once it is generated use ur command(c:\Program Files\Java\jdk1.5.0_13\bin>keytool -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android) to generate MD5.

this is used to generate api key for google map.

Hiren Dabhi
  • 3,693
  • 5
  • 37
  • 59
5

You should execute the keytools from c:\Program Files (x86)\java\jre6\bin>

And here execute the keytool command without "\"

keytool -list -alias androiddebugkey -keystore C:\Users\<you_user_name>\.android\debug.keystore -storepass android -keypass android

It will work!

Dmytro Zavalkin
  • 5,265
  • 1
  • 30
  • 34
Daniel Ponce
  • 51
  • 1
  • 1
3

You might try adding c:\Program Files\Java\jdk1.5.0_13\bin to your PATH, then running the keytool command from the C:\android directory. That's what I do (more or less -- I have JDK6 and a different directory), and it works fine.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Sorry but i dont understand what you mean by adding "c:\Program Files\Java\jdk1.5.0_13\bin to your PATH" Could you explain again? sorry for my ignorance – Capsud Apr 14 '10 at 18:14
  • Sorry yea i know what you mean. I do add it to my path, I run 'keytool -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android' from the jdk\bin path and still it doesn't work. I think there is something wrong with the debug.keystore file itself. – Capsud Apr 14 '10 at 18:22
3

There are times when your .android folder is present in the C:\Documents and Settings path. Often, because of the spaces in Documents and Settings, the command will not run properly.

It's better if you just create a test folder under C: and put your debug.keystore file in this folder. Then give the path as:

keytool -list -alias androiddebugkey -keystore "C:\test\debug.keystore" -storepass android -keypass android 

This works. If somebody is facing issues and getting an error on this command, you can try your luck with this.

Jason Plank
  • 2,336
  • 5
  • 31
  • 40
1

I had the same message and when checking the C:\user.android directory could see that the debug.keystore file was not present. As this was the first time I'd tried an android project on this machine, there had been no previous builds. I created and ran the ubiquitous 'Hello World' project and debug.keystore was instantly created. I then ran keytool and the MD5 appeared fine

1

To generate the debug.keystore, you have to run any app at least one time. Just create and run any simple "Hello World" android app to generate it.

  1. Create Hello World android App

  2. Run Hello World android app

toha
  • 5,095
  • 4
  • 40
  • 52
0
keytool error: java.lang.Exception: Keystore file does not exist: C:\android\debug.keystore

Tells me that file isn't there like you think it is.

Also, if you are using the Eclipse Android tools, you can export a signed APK file via Eclipse, which might be easier for you than using the command line tools.

Mark B
  • 183,023
  • 24
  • 297
  • 295
  • it's definitely there as i can see it there. the only thing is that the keystore file is set to open with 'notepad' by mistake. i think that cud be the problem. how can i change this or make it forget its association with notepad? – Capsud Apr 14 '10 at 20:16
  • Sounds like your file had a .txt extension. Was that the case? – Mark B Apr 14 '10 at 20:36
  • the file was actually called debug.keystore.keystore instead of debug.keystore. i had renamed it before and only noticed the problem when i went into the files properties. :) – Capsud Apr 14 '10 at 21:13
0

First i wentto the bin directory and then

get where your debug.key is ..mainly at the .android and it worked like a charm

where androiddebugkey is the name you give

C:\Program Files\Java\jdk1.8.0_66\bin>keytool -exportcert -list -v -alias androiddebugkey  -keystore C:\Users\001557\.android\debug.keystore
Goodlife
  • 3,822
  • 2
  • 24
  • 23