相关文章推荐
豪爽的大海  ·  Accurate and ...·  1 年前    · 
坚强的遥控器  ·  WinDbg ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I was following Step 3 from https://developers.google.com/nearby/messages/android/get-started but I entered the wrong keystore password and now I am getting a "Invalid keystore format". Please advise how to fix? Here's the full stacktrace:

mymacbook .android $ keytool -exportcert -alias \
> androiddebugkey -keystore \
> ~/.android/debug.keystore -list -v
Enter keystore password:  
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
java.io.IOException: Keystore was tampered with, or password was incorrect
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:780)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56)
    at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
    at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at sun.security.tools.keytool.Main.doCommands(Main.java:889)
    at sun.security.tools.keytool.Main.run(Main.java:340)
    at sun.security.tools.keytool.Main.main(Main.java:333)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:778)
    ... 7 more
mymacbook .android $ keytool -exportcert -alias \
> > androiddebugkey -keystore \
> > ~/.android/debug.keystore -list -v
mymacbook .android $ keytool -exportcert -alias \
> androiddebugkey -keystore \
> ~/.android/debug.keystore -list -v
keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:658)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56)
    at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
    at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at sun.security.tools.keytool.Main.doCommands(Main.java:792)
    at sun.security.tools.keytool.Main.run(Main.java:340)
    at sun.security.tools.keytool.Main.main(Main.java:333)
mymacbook .android $ 

And now whenever I type the following command I just keep getting the "invalid keystore format" error and it doesn't even ask me to enter password now:

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

What about those two lines: "> ~/.android/debug.keystore -list -v Enter keystore password:"? – Jan Slominski Jun 10, 2017 at 9:22 Actually, that was when I entered the password incorrectly the first time and now this keeps happening. When I type the command " keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v" it does not ask me for a password ever again because i get that error – M Garp Jun 10, 2017 at 9:23 remove you mean delete it completely? Please elaborate how do I regenerate it back using Android Studio? – M Garp Jun 10, 2017 at 9:30

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.