fix(android): keep plugin annotation types from R8 full mode

Merged
RI
14d ago
+2-1

What

  • Add explicit -keepattributes *Annotation* in android/capacitor/proguard-rules.pro so R8 full mode does not strip Capacitor annotation metadata that plugins rely on at runtime.
  • Keep -keep @interface com.getcapacitor.annotation.** and related rules so reflection and plugin registration keep working.

Why

  • R8 can treat annotation types as unused and optimize away annotation data that Capacitor reads via reflection.

How

  • Restore consumer ProGuard defaults for annotation retention next to the existing -keep @interface rules.

Testing

  • Pushed to this branch; rely on CI on the PR.

Not Tested

  • Local Android release build with R8 full mode.
Open in Web Open in Cursor 

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the retention of Android app metadata in release builds. No changes to app behavior or available features are included in this update.