Enabling hermes, crashes expo development build instantly.
See original GitHub issueSummary
I’m trying to enable the hermes on my app. I followed expo using hermes instructions to enable hermes. But when i change the expo.jsEngine=jsc to expo.jsEngine=hermes in build.properties and build the app it crashes instantly with below error.

Managed or bare workflow? If you have made manual changes inside of the ios/ or android/ directories in your project, the answer is bare!
bare
What platform(s) does this occur on?
Android
Package versions
“dependencies”: { “@ampproject/remapping”: “^2.2.0”, “@expo/config-plugins”: “^4.1.0”, “@expo/prebuild-config”: “^4.0.0”, “@jridgewell/trace-mapping”: “^0.3.13”, “@react-native-community/netinfo”: “8.2.0”, “@react-native-google-signin/google-signin”: “^7.2.2”, “@react-navigation/drawer”: “^6.4.1”, “@react-navigation/native”: “^6.0.10”, “@react-navigation/native-stack”: “^6.6.2”, “@react-navigation/stack”: “^6.2.1”, “@robinbobin/react-native-google-drive-api-wrapper”: “^1.2.3”, “docx”: “^7.3.0”, “eas-cli”: “^0.54.1”, “expo”: “~45.0.0”, “expo-build-properties”: “~0.2.0”, “expo-cli”: “^5.5.1”, “expo-clipboard”: “~3.0.1”, “expo-dev-client”: “~1.0.1”, “expo-file-system”: “~14.0.0”, “expo-in-app-purchases”: “~13.0.0”, “expo-modules-autolinking”: “^0.8.1”, “expo-navigation-bar”: “~1.2.0”, “expo-permissions”: “^13.2.0”, “expo-splash-screen”: “~0.15.1”, “expo-system-ui”: “^1.2.0”, “formik”: “^2.2.9”, “global”: “^4.4.0”, “hermes-engine”: “^0.5.2-rc1”, “moti”: “^0.18.0”, “nanoid”: “^3.3.4”, “react”: “17.0.2”, “react-dom”: “17.0.2”, “react-native”: “0.68.2”, “react-native-actions-sheet”: “^0.6.1”, “react-native-appearance”: “^0.0.0”, “react-native-document-picker”: “^8.1.1”, “react-native-draggable-flatlist”: “^3.1.2”, “react-native-fs”: “^2.20.0”, “react-native-gesture-handler”: “~2.2.1”, “react-native-get-random-values”: “~1.8.0”, “react-native-google-drive-api-wrapper”: “^1.4.0”, “react-native-google-mobile-ads”: “^6.3.0”, “react-native-mmkv”: “^2.4.3”, “react-native-navigation-bar-color”: “^2.0.1”, “react-native-paper”: “^4.12.1”, “react-native-reanimated”: “~2.8.0”, “react-native-restart”: “^0.0.24”, “react-native-safe-area-context”: “4.2.4”, “react-native-screens”: “~3.11.1”, “react-native-select-dropdown”: “^2.0.0”, “react-native-svg”: “12.3.0”, “react-native-system-navigation-bar”: “^1.0.4”, “react-native-tags”: “^2.2.1”, “react-native-toast-notifications”: “^3.2.3”, “react-native-web”: “0.17.7”, “rn-fetch-blob”: “^0.12.0”, “xlsx”: “^0.18.5”, “yup”: “^0.32.11”
Environment
expo-env-info 1.0.4 environment info: System: OS: Windows 10 10.0.22000 Binaries: Node: 16.16.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD SDKs: Android SDK: API Levels: 28, 31 Build Tools: 30.0.2, 31.0.0, 33.0.0 System Images: android-31 | Google Play Intel x86 Atom_64 IDEs: Android Studio: AI-212.5712.43.2112.8609683 npmPackages: expo: ~45.0.0 => 45.0.6 react: 17.0.2 => 17.0.2 react-dom: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-native-web: 0.17.7 => 0.17.7 Expo Workflow: bare
Reproducible demo
app.json
"expo": {
"jsEngine": "hermes",
}
app/build.gradle
project.ext.react = [
enableHermes: (findProperty('expo.jsEngine') ?: "jsc") == "hermes",
]
...
def enableHermes = project.ext.react.get("enableHermes", false);
...
if (enableHermes) {
debugImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim(), "../android/hermes-debug.aar"))
releaseImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim(), "../android/hermes-release.aar"))
} else {
implementation jscFlavor
}
...
gradle.properties
# The hosted JavaScript engine
# Supported values: expo.jsEngine = "hermes" | "jsc"
expo.jsEngine=hermes
Stacktrace (if a crash is involved)
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Related StackOverflow Question
I am having the same issue with bare expo app, release builds crash immediately and I have changed the implementation to use bundled hermes in build.gradle
For anyone still having issues, none of the above solutions worked for me. This was a long shot but it worked.
1 - remove packaging options from “expo-build-properties” in your app.json expo plugins. 2 - run expo prebuild --clean 3 - cd into android and run ./gradlew 4- - run expo run:android
And it worked. Hope it helps anyone.