Repository navigation
Conversation
OS-pedrogustavobilro
left a comment
There was a problem hiding this comment.
Tested on Capacitor apps on AGP 8 and 9 with multiple plugins (including ones with permissions and activity callbacks), no crashes, all is working. Nice!
I'm leaving a non-blocker comment but approving the PR.
| -keep class * extends androidx.room.RoomDatabase { void <init>(); } | ||
| -keep class * implements com.google.firebase.components.ComponentRegistrar { void <init>(); } |
There was a problem hiding this comment.
If you open this file in Android Studio for a plain capacitor app, you'll get Unresolved class name with a red highlight (+ <class member name>, '[' or semicolon expected, got '<init>' for the methods).
While I don't see this as a warning nor build failure nor runtime issue, just the IDE notifying, maybe it's worth clarifying that not all Capacitor apps will have this code by default but these rules are here to prevent certain plugins (like the official capacitor health&fitness plugin or even community plugins) or Firebase setups from having issues?
There was a problem hiding this comment.
I updated the comment and added #noinspection ShrinkerUnresolvedReference so the warnings disappear
There was a problem hiding this comment.
Dropped the Room and Firebase lines per Julio’s review, so these warnings are gone too. The plugins that need those rules ship them now.
…ferred conflicts)
Description
Adds a keep rule to core's
proguard-rules.profor@ActivityCallbackand@PermissionCallbackmethods on anyPluginsubclass. #8646 keeps the annotation types, but R8 still drops these callbacks when they're declared on a non-public base class.Tested on 8.5.3 with R8 on and
proguard-android-optimize.txt. With #8646 alone, an@ActivityCallbackon a package-private base class fails with "There is no ActivityCallback method registered". With this rule it resolves as with R8 off.Change Type
Rationale / Problems Fixed
https://outsystemsrd.atlassian.net/browse/RMET-5521
Platforms Affected
Notes
The Room and Firebase rules from the first version now ship in the plugins that need them, per review. Capacitor 9 gets the same rule in #8658.