Skip to content

Instantly share code, notes, and snippets.

@gouravkhunger
Created July 9, 2024 05:25
Show Gist options
  • Save gouravkhunger/2974f5068d603fd5e9b8eefe2f346d7e to your computer and use it in GitHub Desktop.
Save gouravkhunger/2974f5068d603fd5e9b8eefe2f346d7e to your computer and use it in GitHub Desktop.
Rename output APKs for split ABIs (Kotlin DSL)
// ...
android {
// ...
applicationVariants.configureEach {
val archMap = mapOf(
"x86" to "i686",
"x86_64" to "x86_64",
"armeabi-v7a" to "arm",
"arm64-v8a" to "aarch64"
)
// rename the output APK file
outputs.configureEach {
(this as? ApkVariantOutputImpl)?.outputFileName =
"${rootProject.name.lowercase()}-${
archMap[filters.find {it.filterType == "ABI" }?.identifier] ?: "universal"
}${if (buildType.name == "debug") "-debug" else ""}.apk"
}
}
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment