密钥库被篡改或密码不正确[英] Keystore was tampered with or password was incorrect

问题描述

我知道已经存在这样的问题,但我找不到任何可以帮助我的答案.

我正在尝试使用此命令使用MD5键的Google Maps API密钥:

keytool -list -v -alias androiddebugkey -keystore "/Users/Sachin Parashar/.android/debug.keystore" -storepass android -keypass android

但它给出了此错误:

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:225)
    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)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:778)
    ... 7 more

任何人都知道这个命令有什么问题吗?

推荐答案

读取堆栈特许.当您的密码错误时,会提出此错误.

在您正在处理debug密钥库时,您可以删除它并创建一个新的.

首先,删除此文件

/Users/Sachin Parashar/.android/debug.keystore
然后,运行(在同一文件夹上,即/Users/Sachin Parashar/.android/)

keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

最后,您可以在

之前运行您尝试的内容
keytool -list -v -alias androiddebugkey -keystore "/Users/Sachin Parashar/.android/debug.keystore" -storepass android -keypass android

本文地址:https://www.itbaoku.cn/post/978571.html