Why is this bundleReleaseJsAndAssets failing when hermes is enabled on build.gradle?

Viewed 1502

I just cloned this repository and there is this error.

When I try to run ./gradlew installRelease or npx react-native run-android --variant=release, I get this error because of Hermes. Yes I enabled Hermes on my build.gradle. It works without hermes.

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
...
info Done writing sourcemap output
info Done writing bundle output
info Copying 13 asset files
info Done copying assets

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> A problem occurred starting process 'command '../../node_modules/hermes-engine/osx-bin/hermes''

I am using macos.

I ran yarn add hermes-engine to make sure this node module exists. I have found many github issues but they are mostly talking about windows.

2 Answers

Just check if you are using windows and if your PC is just a year older, then u have to uninstall visual c++ 2019 redistributable, install visual c++ 2015 redistributable.

if u have linux, then no extra need.

I think this issue is happening because you might have done build 2-3 times. So my advice is just do cd android & gradlew clean & gradlew assembleRelease.

Can u check your react native version? Hermes only works for react-native >= 0.60.4. Also some modules like react-native-firebase (if you are using in your project), are still not compatible with Hermes.Also if you are building app bundles instead apk, then make sure that react-native version should be 0.62 or more.

Related