[英]Setting Android version code in Ionic 2 / Cordova
I'm completely stuck with a crazy issue.我完全被一个疯狂的问题困住了。 I'm not able to publish an update of my app in Google Play store because current version code is 101002 .我无法在 Google Play 商店中发布我的应用程序更新,因为当前版本代码是101002 。
Now, I don't understand how that code was generated.现在,我不明白该代码是如何生成的。 In my config.xml I tried using the following versions:在我的 config.xml 我尝试使用以下版本:
1.3
1.3.1
1.3.1.1
but every time it generates a version code like:但每次它生成一个版本代码,如:
10300
10310
10311
that is always lower than the current version code: 101002始终低于当前版本代码:101002
I also tried to build using the following command:我还尝试使用以下命令进行构建:
ionic cordova build android --prod --release -- -- --versionCode=103020
but it doesn't work但它不起作用
I can't manually set the version code of the Manifest file because it's generated by ionic 2 build process.我无法手动设置 Manifest 文件的版本代码,因为它是由 ionic 2 构建过程生成的。 Any idea?任何的想法?
You can specify a custom version-code in config.xml
.您可以在config.xml
指定自定义版本代码。 Add the following property to the <widget>
element (the root element): android-versionCode="101003"
.将以下属性添加到<widget>
元素(根元素): android-versionCode="101003"
。
This is an example of a full <widget>
tag with more properties that are probably useful:这是一个完整的<widget>
标签示例,其中包含更多可能有用的属性:
<widget android-versionCode="100" id="your.bundle.id" ios-CFBundleVersion="1.0.0" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
version
is the version displayed in the app stores, can stay the same across different builds version
是应用商店中显示的版本,可以在不同版本中保持相同android-versionCode
this is used by Google-Play to differentiate between your builds, must always be higher than the previous one android-versionCode
这是 Google-Play 用来区分您的构建的,必须始终高于前一个CFBundleVersion
is used by iTunesConnect to differentiate your builds, must always be higher than the previous one iTunesConnect 使用CFBundleVersion
来区分您的构建,必须始终高于前一个id
is where you define the bundle identifier of your app, this must always stay the same id
是您定义应用程序包标识符的地方,它必须始终保持不变
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.