无法在 AndroidStudio 中打开密钥库 - “发现冗余长度字节" [英] Unable to open keystore in AndroidStudio - "Redundant length bytes found"

查看:44
本文介绍了无法在 AndroidStudio 中打开密钥库 - “发现冗余长度字节"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在 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

看截图:

显然这是一个应该使用 JDK8_131<解决的问题/a> 但对我不起作用.(我们都在使用 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: Redundant length bytes found),他们将 .pkc12 文件转换为 .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 上失败,因为他们正在将构建移动到他们的新发行版 trusty 下载最新的 JDK 而 precise 默认使用 JDK7.将 dist:precision 添加到 .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 应用签名.

我们使用装有 JDK 7 的机器来执行应用签名教程中描述的所有步骤.

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆