<-- Back

Custom developer app fails on Android: Wrong bytecode version. Expected 96 but got 98

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:

  1. Open the package.json file of the Native Template.
  2. Add the following entry to the existing overrides section:

    "hermes-compiler": "0.15.1"
  3. Delete the node_modules folder and run npm install again.
  4. Confirm that the node_modules/hermes-compiler/package.json file shows version 0.15.1.
  5. Rebuild the custom developer app.

Internal information related

  • 291413, 289784, 282498
  • MOO-2548
  • C07BE6K6F5L/p1793972996468409

Additional information

Mendix documentation:

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.