build: split apks per ABI when building

This commit is contained in:
2024-01-19 20:47:36 +02:00
committed by Illusion
parent f5afb3b25c
commit 52634a98e4
+17 -2
View File
@@ -50,6 +50,20 @@ android {
"proguard-rules.pro" "proguard-rules.pro"
) )
signingConfig = signingConfigs.getByName("release") signingConfig = signingConfigs.getByName("release")
splits {
abi {
// Enables building multiple APKs per ABI.
isEnable = true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for armeabi-v7a, arm64-v8a, x86 and x86_64.
// Resets the list of ABIs that Gradle should create APKs for to none.
reset()
include("x86_64", "x86", "armeabi-v7a", "arm64-v8a")
isUniversalApk = true
}
}
} }
} }
compileOptions { compileOptions {
@@ -69,8 +83,9 @@ android {
androidComponents { androidComponents {
val abiVersionCodes = mapOf( val abiVersionCodes = mapOf(
"x86_64" to 1, "x86_64" to 1,
"armeabi-v7a" to 2, "x86" to 2,
"arm64-v8a" to 3, "armeabi-v7a" to 3,
"arm64-v8a" to 4,
) )
onVariants { variant -> onVariants { variant ->