Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enabling Hermes breaks android/iOS builds

See original GitHub issue


"react": "^17.0.2"
"react-native": "^0.64.2"
"webpack": "^5.44.0"
"@callstack/repack": "^2.0.0-beta.7"


On android, if we enable hermes as seen below, assembling the app fails to execute on task app:bundleReleaseJsAndAssets. However, if we switch back to using the metro bundler, Hermes works fine. We want to keep using repack for the webpack benefits, but also need Hermes for the project.

project.ext.react = [
    entryFile: "index.js",
    enableHermes: true,
    bundleCommand: "webpack-bundle", // removing this line fixes the error

Reproducible Demo

  1. Create new react native app
  2. Follow callstack/repack documentation for installation and setup
  3. Copy-paste the webpack config template
  4. Enable Hermes for android build and assemble release build



▸ Linking

❌  ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/stephenlu/Documents/heroai/frontend/app/ios/Pods/hermes-engine/destroot/Library/Frameworks/iphoneos/hermes.framework/hermes' for architecture arm64

❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with, by opening beaconapp.xcworkspace.

The following build commands failed:
	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/stephenlu/Library/Developer/Xcode/DerivedData/beaconapp-akmcdfwbbupxepbpqfxdjntkinhn/Build/Intermediates.noindex/
(1 failure)

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit for documentation about this command.


> Task :app:bundleDevReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* Where:
Script '/Users/stephenlu/Documents/heroai/frontend/app/node_modules/react-native/react.gradle' line: 173

* What went wrong:
Execution failed for task ':app:bundleDevReleaseJsAndAssets'.
> Process 'command '../../node_modules/hermes-engine/osx-bin/hermesc'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.


Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

TheMatrixMastercommented, Sep 15, 2021

Alright, so I was able to successfully run both commands. For future reference, these are the packages that I had to add to the babel loader rules:


Thanks so much @zamotany for your help!

ohheyitskartikcommented, Apr 25, 2022

@TheMatrixMaster how did you find out all the dependencies which needed babel transpiling ? if you can explain the process, that would be grt i am stuck in a similar situation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Hermes - React Native
Hermes is an open-source JavaScript engine optimized for React Native. For many apps, using Hermes will result in improved start-up time, ...
Read more >
React Native Firebase
React Native Firebase · 1. Install via NPM · 2. Android Setup · 3. iOS Setup · 4. Autolinking & rebuilding · Android...
Read more >
React Native (Android) - Failed to transform hermes-debug.aar
1. After using command npx react-native upgrade , there are changes in number version of dependencies. I also edit build.gradle in ...
Read more >
React Native: What You Need To Know About Hermes.
TL;DR: Hermes is an open-source lightweight JavaScript engine optimized for React Native built by Facebook, It improves performance by ...
Read more >
Troubleshooting my builds - Help Center - Jscrambler Docs
Application breaks on Hermes Engine. Problem. Hermes is an open-source JavaScript engine optimized for React Native. Some of those optimizations cause a mal- ......
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 Post

No results found

github_iconTop Related Hashnode Post

No results found