Skip to content

fix(android): AGP 9.0 no longer supports proguard-android.txt#684

Merged
robingenz merged 1 commit intocapacitor-community:masterfrom
VIXI0:patch-1
Mar 7, 2026
Merged

fix(android): AGP 9.0 no longer supports proguard-android.txt#684
robingenz merged 1 commit intocapacitor-community:masterfrom
VIXI0:patch-1

Conversation

@VIXI0
Copy link
Contributor

@VIXI0 VIXI0 commented Mar 6, 2026

Replace getDefaultProguardFile('proguard-android.txt') with getDefaultProguardFile('proguard-android-optimize.txt') in android/build.gradle.

proguard-android.txt is no longer supported in AGP 9+ since it includes -dontoptimize, which prevents R8 from performing optimizations. This causes a build failure for projects using Android Gradle Plugin 9.x.

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.

Replace getDefaultProguardFile('proguard-android.txt') with getDefaultProguardFile('proguard-android-optimize.txt') in android/build.gradle.

proguard-android.txt is no longer supported in AGP 9+ since it includes -dontoptimize, which prevents R8 from performing optimizations. This causes a build failure for projects using Android Gradle Plugin 9.x.
Copilot AI review requested due to automatic review settings March 6, 2026 02:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Android library Gradle configuration to use the AGP-recommended default Proguard file, improving forward compatibility with newer Android Gradle Plugin versions.

Changes:

  • Switches getDefaultProguardFile('proguard-android.txt') to getDefaultProguardFile('proguard-android-optimize.txt') for the release build type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@VIXI0 VIXI0 closed this Mar 6, 2026
@VIXI0 VIXI0 reopened this Mar 6, 2026
@robingenz robingenz changed the title Fix deprecated proguard-android.txt for AGP 9+ compatibility fix(android): AGP 9.0 no longer supports proguard-android.txt Mar 7, 2026
@robingenz robingenz merged commit 5305e38 into capacitor-community:master Mar 7, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants