How to update app version in Cordova

我与影子孤独终老i 提交于 2019-12-12 01:59:00

问题


I've done this before, but quite a long time a go

For what I remember, setting version attribute in config.xml, that was it

The thing is that I had

<widget id="com.toniweb.appname" version="1.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

And changed to:

<widget id="com.toniweb.appname" version="1.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

But when I upload the signed version to google play, I got this error:

"El código de versión del APK debe ser superior a (Version of code must be greater than) 1100101008."

And searched in the code and yes, in fact, it isn't updated even if changing the version attribute

I build the .apk like this:

cordova prepare
cordova build --release android

And I sign it like this:

jarsigner -verbose -sigalg SHxxxxxxSA -digestalg SHA1 -keystore ../apk/android-release-unsigned.keystore  android-release-unsigned.apk appnameAndroidKey
android-release-unsigned.apk appname1.2.apk

Any idea what I'm missing?


回答1:


Go to your AndroidManifest.xml and increase android:versionCode and android:versionName.To know how to increase you can go to this reference link.

If you are using cordova make change in config.xml .As you previous version is 1.100111,Change it to 1.100112 or 1.200000. After that build your application again.




回答2:


Before copying platform files for building, first cleanup project from build artifacts : cordova clean

And after that build your project : cordova build

Maybe by cleaning old artifacts your problem will be solved.



来源:https://stackoverflow.com/questions/38551198/how-to-update-app-version-in-cordova

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