cordova 5.0 generate signed apk

六眼飞鱼酱① 提交于 2019-12-11 02:57:07

问题


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

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".

There is no problem with the code.

Anyone can give me some suggestion? Thanks.


回答1:


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>



回答2:


If you used Android Studio, you can try with Intellij IDEA (Android Studio is performed by Intellij Platfrom ) here.

After importing your projet, simple go to :

Build > Generate Signed APK..

You'll need to create a key and then Intellij will create your APK.

If you still have your error "unfortunaly..." connect your device and check Intellij logs.



来源:https://stackoverflow.com/questions/30653389/cordova-5-0-generate-signed-apk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!