34

I'm getting this error.

C:\Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\Suresh\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

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

java.lang.Exception: Keystore file does not exist: C:\Users\Suresh\.android\debug.keystore

at sun.security.tools.KeyTool.doCommands(Unknown Source)
at sun.security.tools.KeyTool.run(Unknown Source)
at sun.security.tools.KeyTool.main(Unknown Source)

C:\Program Files\Java\jre7\bin>

enter image description here

5
  • Have you checked that the debug.keystore actually exists in the path you are specifying? Commented Mar 10, 2013 at 6:02
  • debug.keystore file does not exist "C:\Users\Suresh\.android\" Commented Mar 10, 2013 at 6:04
  • Yes. I read the OP and I know exactly what it means. My question is, does the debug.keystore file exist in the path your specifying in the command? Commented Mar 10, 2013 at 6:05
  • In the path debgu.keystore file not created(or not existed) Commented Mar 10, 2013 at 6:08
  • So what's your question? 'keytool -list' doesn't create keystores, and there's nothing 'default' about that one, except in your mind. Commented Mar 10, 2013 at 7:10

7 Answers 7

28

You must be providing the wrong path to the debug.keystore file.

Follow these steps to get the correct path and complete your command:

  1. In eclipse, click the Window menu -> Preferences -> Expand Android -> Build
  2. In the right panel, look for: Default debug keystore:
  3. Select the entire box next to the label specified in Step 2

And finally, use the path you just copied from Step 3 to construct your command:

For example, in my case, it would be:

C:\Program Files\Java\jre7\bin>keytool -list -v -keystore "C:\Users\Siddharth Lele.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

UPDATED:

If you had already followed the steps mentioned above, the only other solution is to delete the debug.keystore and let Eclipse recreate it for you.

Step 1: Go to the path where your keystore is stored. In your case, C:\Users\Suresh\.android\debug.keystore

Step 2: Close and restart Eclipse.

Step 3 (Optional): You may need to clean your project before the debug.keystore is created again.

Source: http://www.coderanch.com/t/440920/Security/KeyTool-genkeypair-exception-Keystore-file

You can refer to this for the part about deleting your debug.keystore file: "Debug certificate expired" error in Eclipse Android plugins

Sign up to request clarification or add additional context in comments.

2 Comments

What about android studio?
@SahilBabbar: It's still available at the same location. In Windows for example: C:\Users\THE_USER\.android\debug.keystore. That part hasn't changed.
27

Use This for MAC users

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

3 Comments

@HarisurRehman, how long did it take for you to finish this command?
@DevetiPutnik didn't take much long. Not more than a couple of minutes
Interesting, I executed it 10 minutes ago and it is still "working". I only get a lot of ^@^@^@^@^@^@^@^@^@ under the command.
4

For Mac Users: The debug.keystore file exists in ~/.android directory. Sometimes, due to the relative path, the above mentioned error keeps on popping up.

3 Comments

I have the latest version of Android Studio (1.5.1) and my debug.keystore isn't there. I can't find it. Any pointers? I'm using OSX El Capitan.
Same problem with me, Have you solved it yet? @Rameez Hussain
This might be due to SIP introduced in OSX El Capitan and due to this, community support becomes weak as new concepts are introduced in El Capitan. You'll have to personally solve it, and community can only provide pointers for some time.
2

For Mac/Linux debug keystore, the Android docs have:

keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore

But there is something that may not be obvious: If you put the backslash, make sure to do a shift + return in terminal after the backslash so that the second that starts with -alias is on a new line. Simply pasting as-is will not work.

Your terminal (if successful) will look something like this:

$ keytool -exportcert -list -v \
→ -alias androiddebugkey -keystore ~/.android/debug.keystore
Enter keystore password: 

The default debug password is: android

Side note: In Android Studio you can manage signing in:

File > Project Structure > Modules - (Your App) > Signing

Comments

1

In macOS, open the Terminal and type below command

~/.android

It will navigate to the folder that containing Keystore file (You can confirm it with 'ls' command)

In my case, there is a file named 'debug.keystore'. Then type below command in the terminal from the ~/.android directory.

keytool -list -v -keystore debug.keystore

You will get the expected output.

Comments

1

go to ~/.android if there is no debug.keystore copy it from your project and paste it here then run command again.

Comments

0

if you are working with react native maybe the directory is in the node modules, in my case it was there, for example :

./keytool -list -v -keystore "C:\...\app\node_modules\react-native\template\android\app\debug.keystore" -alias androiddebugkey -storepass android -keypass android

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.