Android: R8 shrinking, optimisation and resource shrinking for the release build
isMinifyEnabled and isShrinkResources on the release build type with proguard-android-optimize.txt and an app proguard-rules.pro that adds no rules: the libraries' consumer rules cover kotlinx.serialization, Room 3, Hilt, Ktor, WorkManager (worker class names kept) and Firebase. Debug is unchanged. Signed release APK 43 356 272 -> 11 019 453 bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
@@ -48,6 +48,11 @@ android {
|
||||
}
|
||||
release {
|
||||
if (releaseStoreFile != null) signingConfig = signingConfigs.getByName("release")
|
||||
// SPEC §10.6: R8 shrinks, optimises and obfuscates the release APK; the libraries' consumer rules plus
|
||||
// proguard-rules.pro. publish-apk.sh keeps build/outputs/mapping/release/mapping.txt next to the APK.
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
# R8 rules for the release build of :app (SPEC §10.6). The libraries in use (kotlinx.serialization, Room 3, Hilt,
|
||||
# Ktor, OkHttp, WorkManager, Firebase messaging, Coil) ship their own consumer rules; add a rule here only for a
|
||||
# failure that was seen and with the reason beside it.
|
||||
Reference in New Issue
Block a user