Skip to content

Commit

Permalink
fix: release build issue with agp > 8.4.0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dead8309 committed Dec 24, 2024
1 parent 21ac680 commit 8fa128e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ android {
buildTypes {
release {
isShrinkResources = true
isMinifyEnabled = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ internal fun Project.configureKotlinAndroid(

buildTypes {
getByName("release") {
/*
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
isMinifyEnabled = true
*/

/*
cannot be used by libraries
isShrinkResources = true
Expand Down

0 comments on commit 8fa128e

Please sign in to comment.