Repository navigation
fix(android): keep JS engine classes from R8 - #179
Merged
Merged
Conversation
alexgerardojacinto
approved these changes
Oct 21, 2026
OS-ruimoreiramendes
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fills the JS engine's
consumer-rules.pro, which the engine already ships to apps. The native engine finds its Java classes by name through JNI, so with R8 on the app aborts at startup withClassNotFoundException: io.ionic.android_js_engine.NativeWebAPI.The rule keeps the engine's own package. Native code uses 12 of its 15 classes, so a narrower rule wouldn't save much.
Tested on Capacitor 8.5.3 with R8 on and the engine built from this branch. Events, JS errors, crypto, text encoding, KV, device, app, badge, timers and fetch all match R8 off, on an emulator and on a Pixel 11 Pro.
Logs
With
main:With this branch:
Change Type
Rationale / Problems Fixed
https://outsystemsrd.atlassian.net/browse/RMET-5526
Platforms Affected
Notes
The engine AAR is rebuilt from source when the plugin is published, so the committed one isn't updated here. Capacitor 9 gets the same rule in a separate PR against
next.