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
If your application is a system application that locate in /system/app(or some others system path) and then you install a newer version with version name(maybe 0.1.9), but the version code same with 0.1.6, system will reset the version to 0.1.6 while the phone restart. Because system think the 0.1.9 and the 0.1.6 is the same version.
SO, you need to increase the VersionCode everytime you release a new version to avoid this problem.
android:versionCode
android:versionName
Based on this You Should increase the versionCode.
Source : developer.android.com