我几个月来一直在构建应用程序的发布版本,现在突然出现此错误。
Failed to read key ******** from store ***** Get Key Failed. Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
到目前为止我做了什么
如果您在签署 App Bundle 或 APK 时遇到类似
block not properly padded
、bad key
或 PKCS12
的错误,请尝试对密钥和密钥库文件使用相同的密码,这对我有用。
最近,Android Studio 开始显示一条消息:“警告:PKCS12 KeyStores 不支持不同的存储和密钥密码。忽略用户指定的 -keypass 值。在 Android Studio 中” - 因此,首先,存储和关键密码应该是一样的,就像其他人说的那样。
此外,即使使用相同的密码也出现此错误后,我意识到我们不能在密码上使用@或$等字符。
只需从存储 jks 文件的文件夹名称中删除空格