Skip to content

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

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

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

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 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:

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 9 gets the same rule in a separate PR against next.

@ItsChaceD
ItsChaceD merged commit 5b267eb into main Oct 23, 2026
6 checks passed
@ItsChaceD
ItsChaceD deleted the fix/RMET-5526/js-engine-keep-rules-cap8 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