我完全陷入了一个疯狂的问题.我无法在 Google Play 商店中发布我的应用更新,因为当前版本代码是 101002.
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.
现在,我不明白该代码是如何生成的.在我的 config.xml 中,我尝试使用以下版本:
Now, I don't understand how that code was generated. In my config.xml I tried using the following versions:
1.3
1.3.1
1.3.1.1
但每次它都会生成一个版本代码,例如:
but every time it generates a version code like:
10300
10310
10311
始终低于当前版本代码:101002
that is always lower than the current version code: 101002
我也尝试使用以下命令进行构建:
I also tried to build using the following command:
ionic cordova build android --prod --release -- -- --versionCode=103020
但它不起作用
我无法手动设置 Manifest 文件的版本代码,因为它是由 ionic 2 构建过程生成的.有什么想法吗?
I can't manually set the version code of the Manifest file because it's generated by ionic 2 build process. Any idea?
您可以在 config.xml
中指定自定义版本代码.将以下属性添加到 <widget>
元素(根元素):android-versionCode="101003"
.
You can specify a custom version-code in config.xml
. Add the following property to the <widget>
element (the root element): android-versionCode="101003"
.
这是一个完整的 <widget>
标签示例,其中包含更多可能有用的属性:
This is an example of a full <widget>
tag with more properties that are probably useful:
<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
是应用商店中显示的版本,可以在不同的构建版本中保持相同android-versionCode
这是 Google-Play 用来区分您的构建的,必须始终高于前一个CFBundleVersion
由 iTunesConnect 用于区分您的构建,必须始终高于前一个id
是您定义应用程序包标识符的位置,它必须始终保持不变
version
is the version displayed in the app stores, can stay the same across different buildsandroid-versionCode
this is used by Google-Play to differentiate between your builds, must always be higher than the previous oneCFBundleVersion
is used by iTunesConnect to differentiate your builds, must always be higher than the previous oneid
is where you define the bundle identifier of your app, this must always stay the same这篇关于在 Ionic 2/Cordova 中设置 Android 版本代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!