keytool错误:java.io.IOException:无效的密钥库格式 - Android

时间:2017-06-10 09:02:32

标签: android keystore

我正在跟踪https://developers.google.com/nearby/messages/android/get-started中的第3步,但我输入了错误的密钥库密码,现在我收到了“无效的密钥库格式”。请告知如何解决?这是完整的堆栈跟踪:

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 $ 

现在每当我输入以下命令时,我只是不断收到“无效的密钥库格式”错误,它甚至不会让我现在输入密码:

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

1 个答案:

答案 0 :(得分:1)

确保你正在传递" android"密码(确保使用小写字母)。