Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't enable hermes #1859

Open
neo773 opened this issue Jun 23, 2023 · 5 comments
Open

Can't enable hermes #1859

neo773 opened this issue Jun 23, 2023 · 5 comments
Labels
bug Something isn't working Needs: Triage 🔍

Comments

@neo773
Copy link

neo773 commented Jun 23, 2023

Environment

react-native -v: 10.2.4
npm ls react-native-macos: 
discord_rn@0.0.1 /Users/neo/Documents/temp/discord_rn
└── react-native-macos@0.71.11
node -v: v18.12.1
npm -v: 8.19.2
yarn --version: 1.22.19
xcodebuild -version:
Xcode 14.3.1
Build version 14E300c

Steps to reproduce the bug

Hi,
I was trying to enable hermes by following the docs
But I get these errors

[!] There are multiple dependencies with different sources for `libevent` in `Podfile`:
- libevent (from `../node_modules/react-native-macos/third-party-podspecs/libevent.podspec`)
- libevent (~> 2.1.12)
[!] The 'Pods-discord_rn-macOS' target has frameworks with conflicting names: hermes.framework.

Expected Behavior

No response

Actual Behavior

No response

Reproducible Demo

No response

Additional context

No response

@neo773 neo773 added the bug Something isn't working label Jun 23, 2023
@Saadnajmi
Copy link
Collaborator

Hi, I think the docs are out of date, and you just need to do the normal setup steps, with one addition:
When you run pod install, run USE_HERMES=1 pod install
Can you let me know if that works?

@neo773
Copy link
Author

neo773 commented Jun 24, 2023

Hi, I think the docs are out of date, and you just need to do the normal setup steps, with one addition: When you run pod install, run USE_HERMES=1 pod install Can you let me know if that works?

That didn't work then I tried manually setting :hermes_enabled to true but it errored out when I ran USE_HERMES=1 pod install

 /usr/bin/curl -f -L -o /var/folders/_k/jhw1fddx4ml1wl__9b55mqy00000gn/T/d20230624-72825-1uh9cw6/file.tgz https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.71.14/react-native-artifacts-0.71.14-hermes-ios-debug.tar.gz --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.6.3'

@Saadnajmi
Copy link
Collaborator

Saadnajmi commented Jun 24, 2023

Hi, I think the docs are out of date, and you just need to do the normal setup steps, with one addition: When you run pod install, run USE_HERMES=1 pod install Can you let me know if that works?

That didn't work then I tried manually setting :hermes_enabled to true but it errored out when I ran USE_HERMES=1 pod install

 /usr/bin/curl -f -L -o /var/folders/_k/jhw1fddx4ml1wl__9b55mqy00000gn/T/d20230624-72825-1uh9cw6/file.tgz https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.71.14/react-native-artifacts-0.71.14-hermes-ios-debug.tar.gz --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.6.3'

I think what's happening is it's trying to download a prebuilt tarball given a React Native version, but our versions don't match React Native upstream, so "0.71.14" doesn't exist. At the current moment, I think you'll have to download Hermes separately, then pass the tarball path to HERMES_ENGINE_TARBALL_PATH like in the PR notes here: #1780

@shwanton
Copy link

shwanton commented Jul 9, 2023

The pre-built Hermes binaries are on Maven Central

I look at the list of latest Hermes releases & find the one that is closest to the macOS release you are using: ie. 0.71.12
The url should look like this (note the release # is in 2 places): https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.71.12/react-native-artifacts-0.71.12-hermes-ios-debug.tar.gz

Download the tarball to your local machine.
Use this url in your pod install

HERMES_ENGINE_TARBALL_PATH=/path/to/tarball/react-native-artifacts-0.71.12-hermes-ios-debug.tar.gz pod install --verbose

The versions might not line up perfectly, but RN upgrades are much more common than Hermes 😅

@eablokker
Copy link

I'm also having issues enabling Hermes in 0.73

I installed the hermes-engine-darwin NPM package like the docs said.

"dependencies": {
  "hermes-engine-darwin": "^0.5.3",
  "react": "18.2.0",
  "react-native": "0.73.2",
  "react-native-macos": "^0.73.0-0"
},

I set :hermes_enabled => true, in the Podfile and run USE_HERMES=1 pod install.

I get this error:

...
Installing hermes-engine (0.73.6)
Installing libevent (2.1.12)
[!] The 'Pods-ReactNativeMacos-macOS' target has frameworks with conflicting names: hermes.framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

4 participants