Repository navigation
fix(android): pin hermes-compiler to V0 to match the Hermes V0 engine - #1343
Open
Andries-Smit wants to merge 1 commit into
Open
Andries-Smit wants to merge 1 commit into
Andries-Smit wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Seen with Mendix 11.12.6 and template 19.1.7. The same
hermes-compilerresolution is onmaster.Root cause
The Hermes engine and the Hermes compiler come from different places:
libhermesvm.so)com.facebook.hermes:hermes-androidandroid/app/build.gradlehermesc)node_modules/hermes-compilerreact-native@0.84.1#1303 (MOO-2419) forced the engine to V0. The compiler doesn't go through Gradle dependency resolution, so that
forcedoesn't reach it.detectOSAwareHermesCommand()in@react-native/gradle-pluginusesnode_modules/hermes-compiler/hermesc/<os>/hermescunlessreact.hermesCommandis set, and it ignoreshermesV1Enabled.Only variants that are not in
debuggableVariants(thedev*flavor) let Gradle compile the JS bundle withhermesc. That's why only the Developer App is affected.appstore*builds ship the Studio Pro bundle, which is already bytecode 96.Fix
Pin
hermes-compilerto0.15.1, the same Hermes release as the forced engine:overrides/resolutions, soreact-native's dependency resolves to it.node_modules/hermes-compiler. Without this, npm nests it underreact-native/node_modules, and the Gradle plugin doesn't look there.iOS isn't affected:
react-native-xcode.shuseshermescfrom thehermes-enginepod.If Hermes V1 is enabled later, remove this pin together with the
hermes-androidforce.Verification (in a project generated from the template)
node_modules/hermes-compiler/hermesc/win64-bin/hermesc.exe -versionreportsHBC bytecode version: 96. Before the pin it was 98.assembleDevDebug:assets/index.android.bundlein the APK has a bytecode 96 header.