In the process of upgrading the react native version to 0.73.X
I noticed that I had to remove this section from the android/app/build.gralde
:
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
}
}
}
Now when I generate a new build, it doesn’t get multiplied by 1000 so it will come out a lower version code that I cannot publish on the Play Store.
If I try to restore the code to multiply it I get:
groovy.lang.MissingPropertyException: Could not get unknown property 'abi' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl
How to restore the same logic?