Build.phonegap 上传或转换 p12 证书文件

Build.phonegap upload or convert a p12 certificate file

我有一个使用 DevExtreme 工具的 phonegap 项目。 它与 phonegap cli-7.1.0 一起使用并且工作正常。

现在我想升级到cli-9.0.0。

我用 https://build.phonegap.com 构建项目 通常,我在这里构建 ipa 文件,并使用 apk 作为模板编译 apk 以使用 DevExtreme 工具发布。

我创建了一个模板 apk,但是当我尝试在 DevExtreme 中使用它时,出现错误"error build android package Index was out of range. Must be non-negative and less than the size of the collection parameter name:index"。

所以,我正在尝试使用 https://build.phonegap.com 直接编译 apk 为此,我需要导入已用于在商店中发布应用程序的相同证书(对吗?)。我的证书是p12文件。

我尝试上传 p12 文件,但收到消息 "Error: extension .p12 did not match expected (keystore)"。好的,所以我用谷歌搜索在 "keystore" 中转换 p12。我找到了这个命令行:

keytool -importkeystore -srckeystore android_certificate.p12 -srcstoretype pkcs12  -destkeystore C:\Program Files\Java\jre1.8.0_211\bin\xxx.jks -deststoretype jks -deststorepass xxx

这创建了一个 jks 文件,但是当我尝试将其上传到 build.phonegap 时,我收到类似的消息:"Error: extension .p12 did not match expected (jks)".

那么,如何将我的 p12 证书转换为 build.phonegap 接受的证书并使用它来创建我的 apk 文件并发布它?

我的问题是应用程序已经发布,所以我必须使用相同的证书而不是新证书(对吗??)

看来我找到了解决办法。使用此命令转换我的 p12 文件有效:

keytool -v -importkeystore -srckeystore android_certificate.p12 -srcstoretype PKCS12 -destkeystore myKey.keystore -deststoretype JKS

Thanks to this question