Skip to content

fix(android): keep JS engine classes from R8 - #180

Merged
ItsChaceD merged 1 commit into
nextfrom
fix/RMET-5526/js-engine-keep-rules
Oct 23, 2026
Merged

ItsChaceD merged 1 commit into
nextfrom
fix/RMET-5526/js-engine-keep-rules

Conversation

@ItsChaceD

Copy link
Copy Markdown
Contributor

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 with ClassNotFoundException: 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 9.0.0-alpha.8 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 next:

F DEBUG   : Abort message: 'terminating due to uncaught exception of type std::runtime_error: java.lang.ClassNotFoundException: io.ionic.android_js_engine.NativeWebAPI'

With this branch:

dispatchEvent("probeEvent") -> {"ok":true,"echoed":"N-BR"}

Change Type

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

Rationale / Problems Fixed

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

Platforms Affected

  • Android
  • iOS
  • Web

Notes

The engine AAR is rebuilt from source when the plugin is published, so the committed one isn't updated here. Capacitor 8 gets the same rule, with a changeset, in a separate PR against main.

@ItsChaceD
ItsChaceD merged commit 865baec into next Oct 23, 2026
4 checks passed
@ItsChaceD
ItsChaceD deleted the fix/RMET-5526/js-engine-keep-rules branch October 23, 2026 14:38
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