Skip to content

fix(android): keep Cordova's config.xml when shrinking resources - #8670

Open
ItsChaceD wants to merge 1 commit into
nextfrom
fix/RMET-5532/android-resource-shrinking-keep
Open

ItsChaceD wants to merge 1 commit into
nextfrom
fix/RMET-5532/android-resource-shrinking-keep

Conversation

@ItsChaceD

Copy link
Copy Markdown
Contributor

Description

Adds a keep file to capacitor-cordova so resource shrinking keeps res/xml/config.xml, which Cordova reads by name to find its plugins. Without it, every Cordova plugin call fails with "Class not found" in an app with shrinkResources true.

Tested on 9.0.0-alpha.8 with R8 and shrinkResources true. A Cordova plugin call fails with "Class not found" without the file and matches a build without resource shrinking with it.

Logs

With next:

E ConfigXmlParser: res/xml/config.xml is missing!
Cordova plugin call -> {"err":"Class not found"}

With this branch:

Cordova plugin call -> {"ok":"hidden-ok"}

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

https://outsystemsrd.atlassian.net/browse/RMET-5532

Platforms Affected

  • Android
  • iOS
  • Web

Notes

Resource shrinking stays off by default. Capacitor 8 isn't affected, since AGP 8's shrinker keeps the file.

This branch has not been deployed

No deployments
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.

2 participants