如何解决“密钥创建有错误:"; [英] How to solve "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中.如果在那里找不到键盘工具,则必须搜索它.
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 All in one Collection\keystorefile.jks
如果您为密钥库和密钥分隔了不同的密码,则需要在步骤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!
这篇关于如何解决“密钥创建有错误:";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!