无法在AndroidStudio中打开密钥库 - “找到冗余长度字节” [英] Unable to open keystore in AndroidStudio - "Redundant length bytes found"
问题描述
我无法在Android Studio中打开现有的密钥库文件,也无法从命令行使用 jarsigner
。
I am unable to open my existing keystore file in Android Studio or use the jarsigner
from the command line.
在这两种情况下,错误信息都是:
In both cases the error message is:
java.security.cert .CertificateException:无法初始化,java.io.IOException:DerInputStream.getLength():找到冗余长度字节
java.security.cert.CertificateException: Unable to initialize, java.io.IOException: DerInputStream.getLength(): Redundant length bytes found
查看截图:< br>
See screenshot:
显然这是一个应该用 JDK8_131 但对我不起作用。 (我们都在使用OSX)
Apparently this was an issue that should be fixed with JDK8_131 but does not work for me. (We are all using OSX)
我也在travis上得到了同样的错误。 (参见下面的更新部分。)
I also get the same error on travis. (See "Update" section below.)
我发现了另一个SO问题( 签署Android应用程序抛出IOException:发现冗余长度字节 )他们转换了 .pkc12
文件到 .keystore
但我们已经在使用 .keystore
I found another SO question (Signing android app throws IOException: Redundant length bytes found) where they converted the .pkc12
file to .keystore
but we are already using .keystore
我发现构建也开始在travis上失败,因为它们正在移动构建到新的发行版可信任
下载最新的JDK,而精确
默认使用JDK7。将 dist:precise
添加到 .travis.yml
文件的顶部现在可以正常工作,但这绝对不是永久性的解决方案。
I found that the build also started failing on travis because they are moving builds to their new distro trusty
which downloads the newest JDK whereas precise
used JDK7 by default. Adding dist: precise
to the top of the .travis.yml
file works for now but this is definitely not a permanent solution.
我们是否只希望JDK更新解决问题,或者有办法从密钥库中删除冗余长度字节?
Can we only hope for a JDK update that fixes the issue or is there a way to remove the redundant length bytes from the keystore?
推荐答案
我们最终通过使用 Google Play App Signing 。
我们使用的是JDK机器7按照App Signing教程中的描述执行所有步骤。
We used a machine with JDK 7 to follow all the steps as described in the App Signing tutorial.
然后我们使用JDK9机器创建了新的密钥库。
We then created the new keystore with a JDK9 machine.
这篇关于无法在AndroidStudio中打开密钥库 - “找到冗余长度字节”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!