android应用自动降级版本 [英] android app automatically downgrade version
问题描述
我制作了一个Android应用程序版本,例如0.1.#
.现在,该版本的版本为0.1.9
,并且代码如下所示:
defaultConfig {
applicationId "myapp.app"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "0.1.9"
multiDexEnabled = true
}
productFlavors {
demo {
versionName "0.1.9-demo"
}
full {
versionName "0.1.9-full"
}
}
问题是当它安装在某些设备(华为Y6 II)中后,在一两天后会自动降级到0.1.6.也许这是一种罕见的情况,我已经在Google中搜索了,但没有得到任何答案.请有人向我解释,非常感谢您的帮助.谢谢
android:versionCode
内部版本号.此数字仅用于确定 一个版本是否比另一个版本更新,编号更高 表示较新的版本.这不是显示的版本号 给用户;该数字由versionName属性设置.价值 必须设置为整数,例如"100".您可以定义它 您想要的,只要每个后续版本都有一个更高的编号.为了 例如,它可以是内部版本号.或者您可以翻译一个版本 通过对"x"和"y"进行编码,将"x.y"格式的数字转换为整数 分别在低16位和高16位中.或者你可以简单地 每次发布新版本时,将数字增加一.
android:versionName
显示给用户的版本号.可以将此属性设置为原始 字符串或作为对字符串资源的引用. 字符串中没有其他字符串 而不是向用户显示. versionCode属性保存 内部使用的有效版本号.
基于此,您应该增加 versionCode .
来源: developer.android.com >
I made a version of my android app, like 0.1.#
. Now, the version is up to 0.1.9
and the code go like this
defaultConfig {
applicationId "myapp.app"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "0.1.9"
multiDexEnabled = true
}
productFlavors {
demo {
versionName "0.1.9-demo"
}
full {
versionName "0.1.9-full"
}
}
the problem is when it's installed in some device (Huawei Y6 II) its automatically downgrade version to 0.1.6 after one/two days. Maybe this is a rare condition, I already search in google but I couldn't get any answer. pls somebody explain to me, I really appreciate your help. thanks
android:versionCode
An internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version number shown to users; that number is set by the versionName attribute. The value must be set as an integer, such as "100". You can define it however you want, as long as each successive version has a higher number. For example, it could be a build number. Or you could translate a version number in "x.y" format to an integer by encoding the "x" and "y" separately in the lower and upper 16 bits. Or you could simply increase the number by one each time a new version is released.
android:versionName
The version number shown to users. This attribute can be set as a raw string or as a reference to a string resource. The string has no other purpose than to be displayed to users. The versionCode attribute holds the significant version number used internally.
Based on this You Should increase the versionCode.
Source : developer.android.com
这篇关于android应用自动降级版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!