Skip to content

fix(android): pin hermes-compiler to V0 to match the Hermes V0 engine - #1343

Open
Andries-Smit wants to merge 1 commit into
mendix:masterfrom
Andries-Smit:fix/pin-hermes-v0-compiler
Open

Andries-Smit wants to merge 1 commit into
mendix:masterfrom
Andries-Smit:fix/pin-hermes-v0-compiler

Conversation

@Andries-Smit

@Andries-Smit Andries-Smit commented Oct 11, 2026 •

Copy link
Copy Markdown

Problem

An Android Developer App (dev flavor) built from the template shows a red screen after tapping LAUNCH:

Related to support ticket https://support.mendix.com/hc/en-us/requests/289784

[runtime not ready]: Error: Non-js exception: Compiling JS failed: Wrong bytecode version. Expected 96 but got 98, sourceURL: index.android.bundle

Seen with Mendix 11.12.6 and template 19.1.7. The same hermes-compiler resolution is on master.

Root cause

The Hermes engine and the Hermes compiler come from different places:

Part Source Version today
Engine (libhermesvm.so) Maven com.facebook.hermes:hermes-android 0.15.1 (bytecode 96), forced in android/app/build.gradle
Compiler (hermesc) npm node_modules/hermes-compiler 250829098.0.9 (Hermes V1, bytecode 98), a dependency of react-native@0.84.1

#1303 (MOO-2419) forced the engine to V0. The compiler doesn't go through Gradle dependency resolution, so that force doesn't reach it. detectOSAwareHermesCommand() in @react-native/gradle-plugin uses node_modules/hermes-compiler/hermesc/<os>/hermesc unless react.hermesCommand is set, and it ignores hermesV1Enabled.

Only variants that are not in debuggableVariants (the dev* flavor) let Gradle compile the JS bundle with hermesc. That's why only the Developer App is affected. appstore* builds ship the Studio Pro bundle, which is already bytecode 96.

Fix

Pin hermes-compiler to 0.15.1, the same Hermes release as the forced engine:

  • In overrides/resolutions, so react-native's dependency resolves to it.
  • As a direct devDependency, so npm hoists it to node_modules/hermes-compiler. Without this, npm nests it under react-native/node_modules, and the Gradle plugin doesn't look there.

iOS isn't affected: react-native-xcode.sh uses hermesc from the hermes-engine pod.

If Hermes V1 is enabled later, remove this pin together with the hermes-android force.

Verification (in a project generated from the template)

  • node_modules/hermes-compiler/hermesc/win64-bin/hermesc.exe -version reports HBC bytecode version: 96. Before the pin it was 98.
  • Clean assembleDevDebug: assets/index.android.bundle in the APK has a bytecode 96 header.
  • On an Android 16 x86_64 emulator, LAUNCH loads the Mendix app with no bytecode error.

The template disables Hermes V1 (hermesV1Enabled=false) and forces the
hermes-android 0.15.1 engine (bytecode 96), but the RN Gradle plugin picks
hermesc from node_modules/hermes-compiler regardless of hermesV1Enabled.
React Native 0.84.1 resolves that to 250829098.0.9 (Hermes V1, bytecode 98),
so the dev flavor bundle failed with "Wrong bytecode version. Expected 96
but got 98".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AYvfyhnk7gh6SZziVGVHAJ

This branch has not been deployed

No deployments
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.

1 participant