cordova 5.0 生成签名的 apk [英] cordova 5.0 generate signed apk

查看:22
本文介绍了cordova 5.0 生成签名的 apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Cordova 5.0.0 开发 android 应用程序,我想在真机上运行该应用程序.

I use Cordova 5.0.0 to develop android app and I would like to run the app on real machine.

我尝试了两种方法来生成签名的 apk,但都失败了,一种是使用命令行对cordova 生成的apk 进行签名.这样在安装apk时会导致解析错误";我尝试的第二种方法是使用 android studio 生成签名的 apk.我的步骤是导入非android studio项目"然后生成签名的apk.通过这种方式,我安装成功但应用程序无法打开并弹出错误信息不幸的是,xx 已停止".

I tried two ways to generate signed apk but failed, One is used command line to sign an apk that generated by cordova. by this way, it will cause "parsing error" when install the apk; The second way I tried is using android studio to generate signed apk. My step is "import non-android studio project" then generate signed apk. By this way, I install successfully but the app can't be open and popup error info "unfortunately, xx has stopped".

代码没有问题.

谁能给我一些建议?谢谢.

Anyone can give me some suggestion? Thanks.

推荐答案

Cordova 5 现在使用 gradle 进行编译,因此旧的 ant.properties 不再有效.您可以通过在平台/android 中创建 release-signing.properties 文件并添加以下内容来使用相同的技巧:

Cordova 5 uses gradle to compile now, so the old ant.properties no longer works. You can work the same trick by creating a release-signing.properties file in platforms/android and adding the following:

storeFile=<path to="" .keystore="" file="">
storeType=jks
keyAlias=<your key="" alias="">
// optional :
keyPassword=<your-key-password>
storePassword=<your-store-password>

这篇关于cordova 5.0 生成签名的 apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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