Skip to content

Commit 8fa128e

Browse files
committed
fix: release build issue with agp > 8.4.0
Starting with agp 8.4.0 setting isMinifyEnabled for libraries will minify the lib much sooner in the build process, as opposed to doing it at the end of the build process. This will cause the app module to use a minified version of the library which will throw missing classes error during compiling for release build. https://stackoverflow.com/a/79148742/25688500
1 parent 21ac680 commit 8fa128e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ android {
2121
buildTypes {
2222
release {
2323
isShrinkResources = true
24+
isMinifyEnabled = true
2425
}
2526
}
2627

build-logic/convention/src/main/kotlin/kizzy/gradle/plugin/KotlinAndroid.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ internal fun Project.configureKotlinAndroid(
3939

4040
buildTypes {
4141
getByName("release") {
42+
/*
43+
Starting with agp 8.4.0 setting isMinifyEnabled for libraries will minify the lib much sooner in the build process,
44+
as opposed to doing it at the end of the build process. This will cause the app module to use a minified
45+
version of the library which will throw missing classes error during compiling for release build.
46+
47+
https://stackoverflow.com/a/79148742/25688500
48+
4249
isMinifyEnabled = true
50+
*/
51+
4352
/*
4453
cannot be used by libraries
4554
isShrinkResources = true

0 commit comments

Comments
 (0)