After upgrade to Gradle 9.9.1, getting "Supplied proguard configuration does not exist" error for Flutter app


Upgrading Gradle from 9.7.1 to 9.9.1 and trying to do a release build produced this error:

Execution failed for task ':app:minifyReleaseWithR8' (registered by plugin 'com.android.internal.application').
Supplied proguard configuration does not exist: /Users/jasonelder/Documents/Flutter/roadbookapp/android/app/build/intermediates/default_proguard_files/global/proguard-android-optimize.txt-9.5.2

Apparently there was a change moving to AGP 9, see https://developer.android.com/build/releases/agp-9-0-0-release-notes#property-android.proguard.failOnMissingFiles, but setting this to false doesn't fix the problem. Also, I was already on AGP 9.

0
Nov 28 at 2:06 PM
User Avatarjaseelder
#android#flutter#gradle

Accepted Answer

After playing around with this a bit, I found a solution.

In android/app/build.gradle , change the getDefaultProguardFile() line to this:

proguardFiles( file("${rootProject.layout.buildDirectory.get().asFile}/app/intermediates/default_proguard_files/global/proguard-android-optimize.txt-${com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION}"), // getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" )

And in android/gradle.properties , add:

android.proguard.failOnMissingFiles=false

That should be sufficient to allow a release build to compile.

User Avatarjaseelder
Nov 28 at 2:17 PM
2