Configure multiple APKs for screen densities
But on Some MI devices Like MI 4 and Note 5 pro its automatically rollback to previous version from playstore .
My code for generation multiple density is
defaultConfig {
compileSdkVersion 26
buildToolsVersion '26.0.2'
minSdkVersion 16
targetSdkVersion 26
versionCode 88
}
ext.versionCodes = [all: 1, mdpi: 2, hdpi: 3, xhdpi: 4, xxhdpi: 5]
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def key = output.getFilter(OutputFile.DENSITY) == null ? "all" : output.getFilter(OutputFile.DENSITY)
output.versionCodeOverride = project.ext.versionCodes.get(key)*100000 + android.defaultConfig.versionCode
}
}
and I have generated previous version code like 1000085,2000085,3000085,4000085 and 5000085
next version will be like 1000086,2000086,3000086,4000086 and 5000086
but on Mi devices its takes random version apk from playstore