Error build release (hermes enable)

See original GitHub issue

Description

Console out:

FAILURE: Build failed with an exception.

  • Where: Script ‘C:\Users\cervi\Desktop\Escuela\proyecto-asistencia@Reset2\TecnicaDigital\node_modules\react-native\react.gradle’ line: 126

  • What went wrong: Execution failed for task ‘:app:bundleReleaseJsAndAssets’.

java.lang.Exception: Couldn’t determine Hermesc location. Please set project.ext.react.hermesCommand to the path of the hermesc binary file. node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc

Version

0.69.1

Output of npx react-native info

System: OS: Windows 10 10.0.22000 CPU: (4) x64 Intel® Core™ i3-7020U CPU @ 2.30GHz Memory: 1.92 GB / 7.88 GB Binaries: Node: 16.13.1 - ~\AppData\Local\Temp\yarn–1656711531736-0.4762878003872508\node.CMD Yarn: 1.22.19 - ~\AppData\Local\Temp\yarn–1656711531736-0.4762878003872508\yarn.CMD npm: 8.12.2 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 28, 29, 30, 31, 32 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0 System Images: android-24 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom Android NDK: 23.1.7779620 Windows SDK: AllowDevelopmentWithoutDevLicense: Enabled AllowAllTrustedApps: Enabled Versions: 10.0.10240.0, 10.0.17763.0, 10.0.18362.0, 10.0.19041.0 IDEs: Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8193401 Visual Studio: 15.9.28307.1919 (Visual Studio Community 2017), 16.11.32407.337 (Visual Studio Community 2019) Languages: Java: 11.0.13 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.69.1 => 0.69.1 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

.

Snack, code example, screenshot, or link to a repository

.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

16reactions
JoseLioncommented, Jul 4, 2022

I faced the same issue with a new application created with react-native init. The problem is that the hermesCommand extra property is missing in the app-level build.gradle file. I solved the problem by adding the correct Hermes Command path, like so:

project.ext.react = [
    enableHermes: true,  // clean and rebuild if changing
    hermesCommand: '../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc'
]

NOTE: Setting the path to ../../node_modules/hermes-engine/%OS-BIN%/hermesc instead will cause a conflict between Hermes versions, which will throw the runtime error Compiling JS failed: Wrong bytecode version. Expected 85 but got 84, causing the app to crash as soon as it starts.

I hope this helps 🙂

7reactions
wferncommented, Jul 7, 2022

I can confirm the @JoseLion’s fix, adding “.exe” in the file path works:

// 3. If the react-native contains a pre-built hermesc, use it.
def hermescBin = Os.isFamily(Os.FAMILY_WINDOWS) ? 'hermesc.exe' : 'hermesc'
def prebuiltHermesPath = ("node_modules/react-native/sdks/hermesc/%OS-BIN%/" + hermescBin)
        .replaceAll("%OS-BIN%", getHermesOSBin())
        .replace('/' as char, File.separatorChar);

Thanks @JoseLion!

Read more comments on GitHub >

github_iconTop Results From Across the Web

hermes has error in release build of react-native 0.60.5
I tried to take release build without Hermes and everything is ok but when I enabled Hermes option in android/app/build.gradle and tried to ......
Read more >
Using Hermes - React Native
Hermes is the default engine as of React Native 0.70. This section explains how to enable Hermes on older versions of React Native....
Read more >
Using Hermes Engine - Expo Documentation
Using Hermes Engine. A guide on configuring Hermes for both Android and iOS in an Expo project. Hermes is a JavaScript engine optimized...
Read more >
How to: enable Hermes JavaScript engine in your React ...
Then we need to declare the Hermes compiled version as dependencies in the build.gradle file. //... debugImplementation files("../../ ...
Read more >
Using Hermes in React Native - LogRocket Blog
Hermes is the headline feature that is shipped with this release. Other changes include enabling inline require for Metro bundler, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found