Issue
A custom developer app fails to start on Android. The app shows the following error when connecting to a running Mendix app:
[runtime not ready]: Error: Non-js exception: Compiling JS failed: Wrong bytecode version. Expected 96 but got 98
Environment
Native Template v19.1.8 and older
Cause
From v19.1.0, Native Template uses React Native 0.84.1. On Android, the template runs the classic Hermes JavaScript engine version 0.15.1, which reads bytecode version 96. React Native 0.84.1 installs a newer Hermes compiler (hermes-compiler) that produces bytecode version 98. The engine cannot load the bundle compiled with the newer compiler.
Only the custom developer app variant compiles the JavaScript bundle with the Hermes compiler during the build, so only that variant is affected.
Solution / Workaround
Native Template 19.1.9 fixes the issue by pinning hermes-compiler to version 0.15.1, which matches the Hermes engine. Upgrade the Native Template to version 19.1.9 or newer and rebuild the custom developer app.
If an upgrade is not possible, pin the compiler manually to the version of the engine by following these steps:
- Open the package.json file of the Native Template.
Add the following entry to the existing
overridessection:"hermes-compiler": "0.15.1"
- Delete the node_modules folder and run
npm installagain. - Confirm that the node_modules/hermes-compiler/package.json file shows version 0.15.1.
- Rebuild the custom developer app.
Internal information related
- 291413, 289784, 282498
- MOO-2548
- C07BE6K6F5L/p1793972996468409
Additional information
Mendix documentation:
0 Comments