feat(android): split release APK per ABI for F-Droid
All checks were successful
release / android (push) Successful in 13m47s
All checks were successful
release / android (push) Successful in 13m47s
Adds a versionCodeOverride to build.gradle.kts (F-Droid requires distinct
versionCodes per split APK; Google Play's App Bundle is unaffected since
this only touches the application-variant/APK output). Bumps to 0.1.2+4.
Verified locally: flutter build apk --release --split-per-abi produces
app-{armeabi-v7a,arm64-v8a,x86_64}-release.apk with versionCode 31/32/33.
This commit is contained in:
parent
bfd29f19b9
commit
8bec7dcde2
5 changed files with 28 additions and 1 deletions
|
|
@ -85,3 +85,21 @@ dependencies {
|
|||
// Backport of Java 8+ APIs, required by flutter_local_notifications.
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||
}
|
||||
|
||||
// F-Droid builds one split APK per ABI (smaller downloads than a universal
|
||||
// APK) and needs each split to carry a distinct versionCode so its repo can
|
||||
// tell them apart; `flutter build apk --split-per-abi` alone gives every
|
||||
// split the same versionCode. This override only touches the APK
|
||||
// (applicationVariants) output, not the App Bundle Google Play consumes, so
|
||||
// Play's per-device delivery is unaffected.
|
||||
val abiVersionCodes = mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86_64" to 3)
|
||||
android.applicationVariants.all {
|
||||
val variant = this
|
||||
variant.outputs.all {
|
||||
val output = this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
|
||||
val abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||||
abiVersionCodes[abi]?.let { abiCode ->
|
||||
output.versionCodeOverride = variant.versionCode * 10 + abiCode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue