在 Cordova v-5.0 CLI 中签名 APK 文件不起作用 [英] Signing APK file in Cordova v-5.0 CLI is not working

查看:21
本文介绍了在 Cordova v-5.0 CLI 中签名 APK 文件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将密钥库属性添加到 platforms/android 目录中的两个文件中.

i tried to add keystore properties into two files in the platforms/android directory.

key.store=Users/admin/workspace/android-keystore/keystore
key.alias=keystore

进入

ant.properties

project.properties 

文件.

它在以前的版本中运行良好,但似乎 Cordova 在最新版本中不使用 ant.

It worked fine in previous version, but not seems like the Cordova does not using ant in latest version.

所以如果我运行命令:

cordova build android --release

我总是只得到未签名的 apk.

I always get only unsigned apk.

platforms/android/build/outputs/apk/android-release-unsigned.apk

请问如何解决?

非常感谢您的帮助.

推荐答案

因为cordova现在使用gradle,你需要在你的platforms/android/目录下创建一个叫release-signing.properties的文件

Because cordova now uses gradle, you need to create a file called release-signing.properties in your platforms/android/ directory

设置如下:

storeFile=relative/path/to/keystore.p12
storePassword=SECRET1
storeType=pkcs12
keyAlias=DebugSigningKey
keyPassword=SECRET2

您也可以使用 JKS 文件:

You can also use JKS files:

storeType=jks
storeFile=mykeystore.keystore

有关更多信息,请参阅:https://cordova.apache.org/docs/en/edge/guide_platforms_android_tools.md.html

For more information see: https://cordova.apache.org/docs/en/edge/guide_platforms_android_tools.md.html

这篇关于在 Cordova v-5.0 CLI 中签名 APK 文件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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