Describe the bug
Using proguard-android.txt in android/build.gradle breaks builds on AGP 9
To Reproduce
Upgrade project to Android Plugin Gradle 9 - in android/build.grade:
classpath 'com.android.tools.build:gradle:9.1.1'
Then build Android project.
Expected behavior
Expect project to build and run normally.
Actual behavior
A problem occurred evaluating project ':app'.
> `getDefaultProguardFile('proguard-android.txt')` is no longer supported since it includes `-dontoptimize`, which prevents R8 from performing many optimizations. Instead use `getDefaultProguardFile('proguard-android-optimize.txt)`, and if needed, temporarily use `-dontoptimize` in a custom keep rule file while fixing breakages.
Additional context
See Android Docs
Fix in android/build.gradle
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Describe the bug
Using
proguard-android.txtinandroid/build.gradlebreaks builds on AGP 9To Reproduce
Upgrade project to Android Plugin Gradle 9 - in
android/build.grade:Then build Android project.
Expected behavior
Expect project to build and run normally.
Actual behavior
Additional context
See Android Docs
Fix in
android/build.gradle