如何解决“Key was created with errors:" [英] How to solve "Key was created with errors:"

查看:46
本文介绍了如何解决“Key was created with errors:"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JKS 密钥库使用专有格式.建议迁移到 PKCS12,这是一种使用keytool"的行业标准格式-importkeystore -srckeystore -destkeystore-deststoretype pkcs12"

The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore -destkeystore -deststoretype pkcs12"

我在生成密钥时在 android studio 3.4(32 位版本)上遇到这种类型的错误,但是当我在另一台带有 android studio 3.4(64 位)的笔记本电脑中生成相同的源代码到 apk 时版本).它在 64 位笔记本电脑和 android studio 中运行良好.

I am getting this type of error with android studio 3.4 (32-bit version) at the time of generating the key, but when I am generating the same source code to apk in another laptop with android studio 3.4 (64-bit version). It works fine in 64-bit laptop and android studio.

推荐答案

今天遇到了同样的问题,Android 似乎想让我们把我们的密钥从 JKS 专有格式迁移到 PKCS12 格式(如警告所示).为此,您需要使用 Android Studio 附带的 keytool.

I encountered the same problem today and it seems that Android wants us to migrate our keys from the JKS proprietary format to the PKCS12 format (as shown in the warning). To do this, you need to use the keytool, which comes with Android Studio.

keytool.exe 通常位于文件夹 C:\Program Files\Android\Android Studio\jre\bin 中.如果你在那里找不到 keytool,那么你必须搜索它.

The keytool.exe is usually located in the folder C:\Program Files\Android\Android Studio\jre\bin. If you cannot find the keytool there, then you have to search for it.

在 Windows 中,打开 cmd 并键入:

In Windows, open the cmd and type:

cd C:\Program Files\Android\Android Studio\jre\bin

当然,如果你的keytool.exe存放在其他位置,则需要在cd

Of course, if your keytool.exe is stored in another location, you need to enter the correct path after cd

在 cmd 中您已经导航到包含 keytool.exe 的文件夹,所以现在您可以在 cmd 中输入以下命令:

In the cmd you already navigated to the folder containing the keytool.exe, so now you can enter the following command into the cmd:

keytool -importkeystore -srckeystore your_keystore_destination\your_keystore_file.jks -destkeystore your_keystore_destination\your_keystore_file.jks -deststoretype pkcs12

别忘了改变

your_keystore_destination\your_keystore_file.jks

使用正确的路径.在您的示例中,它将是

with your correct path. In your example it would be

D:\App Collection\App1 合集\keystorefile.jks

如果你为keystore和key设置了不同的密码,那么你需要在第3步的命令中添加-destkeypass your_key_password

If you sepcified different passwords for the keystore and for the key, then you need to add -destkeypass your_key_password to the command in step 3!

这篇关于如何解决“Key was created with errors:"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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