Skip to content

Commit

Permalink
Reverts "Ensure flutter build apk --release optimizes+shrinks platf…
Browse files Browse the repository at this point in the history
…orm code" (#137433)

Reverts flutter/flutter#136880
Initiated by: camsim99
This change reverts the following previous change:
Original Description:
Since the original PR that supposedly enabled proguard, it was using the android proguard rules that disable optimizations. See initial PR in [0]

This PR changes the flutter gradle plugin to use the `proguard-android-optimize.txt` (instead of `proguard-android.txt`) which will enable optimizations/shrinking of platform code (i.e. java/kotlin).

For a simple flutter hello world this results in a 25% reduction in the resulting DEX file (`classes.dex` of the APK).

[0] f098de1

Fixes flutter/flutter#136879
  • Loading branch information
auto-submit[bot] authored Oct 27, 2023
1 parent 47c3c12 commit 4cae1af
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class FlutterPlugin implements Plugin<Project> {
shrinkResources isBuiltAsApp(project)
// Fallback to `android/app/proguard-rules.pro`.
// This way, custom Proguard rules can be configured as needed.
proguardFiles project.android.getDefaultProguardFile("proguard-android-optimize.txt"), flutterProguardRules, "proguard-rules.pro"
proguardFiles project.android.getDefaultProguardFile("proguard-android.txt"), flutterProguardRules, "proguard-rules.pro"
}
}
}
Expand Down

0 comments on commit 4cae1af

Please sign in to comment.