Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hermes has error in release build of react-native 0.60.5

I upgraded my react-native project from 0.59.4 to 0.60.5 and everything works well. 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 take release build, I got an error as below:

a busy cat

how to solve this problem and enable Hermes for my project?

like image 863
Mahyar Fard Avatar asked Oct 27 '25 04:10

Mahyar Fard


1 Answers

First, try to clean the node_modules and install it again via yarn.

This issue has been fixed in this PR.

You can also fix it by changing the android/app/build.gradle to:

project.ext.react = [
    ...
    hermesCommand: "../../node_modules/hermesvm/%OS-BIN%/hermes",
    ...
]

UPDATE

first add new hermes via:

yarn add --dev [email protected]

then in android/app/build.gradle:

project.ext.react = [
    entryFile: "index.js",
    enableHermes: true,  // clean and rebuild if changing
    hermesCommand: "../../node_modules/hermes-engine/%OS-BIN%/hermes",
]

and also change this:

def hermesPath = "../../node_modules/hermesvm/android/";

to this:

def hermesPath = "../../node_modules/hermes-engine/android/";

then replace node_module/react-native/react.gradle with this file.

If you use Proguard/R8, add this to android/app/proguard-rules.pro:

-keep class com.facebook.hermes.unicode.* { *; }

then clean via gradlew clean and finally:

gradlew assembleRelease

like image 144
MohamadKh75 Avatar answered Oct 29 '25 20:10

MohamadKh75



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!