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

[Hermes] Can't build a new project for dev #128

Closed
bartlomein opened this issue Mar 9, 2024 · 19 comments
Closed

[Hermes] Can't build a new project for dev #128

bartlomein opened this issue Mar 9, 2024 · 19 comments
Labels
bug Something isn't working

Comments

@bartlomein
Copy link

Description

Was having issues with my build so I created a brand new one and tried to run it and getting the same error:

ld: building for 'visionOS-simulator', but linking in dylib (/Users/bart/dev/exampleapp/visionos/Pods/hermes-engine/destroot/Library/Frameworks/xros/hermes.framework/hermes) built for 'macOS'
clang: error: linker command failed with exit code 1 (use -v to see invocation)


** BUILD FAILED **```

### Steps to reproduce

Follow instructions to create a new app, and run it locally without any changes.

### React Native Version

0.73.3

### Affected Platforms

Other (please specify)

### Areas

Other (please specify)

### Output of `npx react-native info`

```text
none

Stacktrace or Logs

none

Reproducer

none

Screenshots and Videos

No response

@okwasniewski
Copy link
Member

Hey, are you running latest version of cmake? Can you also try the latest version of react native visionOS (0.73.7)?

@bartlomein
Copy link
Author

bartlomein commented Mar 10, 2024

Hmm I updated both of those and ran into another issue



The following build commands failed:
	SwiftEmitModule normal x86_64 Emitting\ module\ for\ mmvisionpro (in target 'mmvisionpro' from project 'mmvisionpro')
(1 failure)

At one point it did build with no errors, just when a simulator was not selected, just a Generic Vision Pro device. I have a feeling I might have messed up some XCode setting.

@bartlomein
Copy link
Author

Actually I think I got it!
Had to add hermes to Frameworks, libraries and Embedded content here:

Screenshot 2024-03-10 at 3 42 46 PM

@josh-deprogram
Copy link

I'm hitting the same problem...

CMake - 3.28.3
RN-VisionOS - 0.73.7
XCode - 15.3
VisionOS - 1.1

Adding libReact-hermes.a to Frameworks doesn't seem to resolve either

@josh-deprogram
Copy link

josh-deprogram commented Mar 11, 2024

Aha! I have it compiling, disabled hermes from pods and removed the framework in Xcode..
For anyone else kicking the compiler try, and doesn't mind running without Hermes
:hermes_enabled => false,

@robertherber
Copy link

@josh-deprogram Thanks, also got it running by disabling Hermes for now 👍

@jariwalabhavesh
Copy link

@josh-deprogram Thanks, I had disable hermes in root ios and visionos podfile and it start working.
Thanks

@okwasniewski
Copy link
Member

@okwasniewski okwasniewski added the bug Something isn't working label Mar 27, 2024
@15bedirhan
Copy link

I tried out RC release version but still have same error. Any updates on this?

Screenshot 2024-03-27 at 15 05 50

@okwasniewski
Copy link
Member

@15bedirhan Do you have the latest version of cmake? (3.29.0 or 3.28.4)?

@15bedirhan
Copy link

@15bedirhan Do you have the latest version of cmake? (3.29.0 or 3.28.4)?

Yes my cmake version is 3.29.0.

For now I continue disabled hermes in visionos/podfile. It works after that
Screenshot 2024-03-27 at 15 30 09

@okwasniewski
Copy link
Member

Okay I did some investigation together with @thiagobrez, looks like it's Logging.cpp file from Hermes which causes those issues for some people. It must be some missing tool/library as its not happening on my Mac.

@thiagobrez
Copy link

thiagobrez commented Apr 12, 2024

Workaround for now:

  • Double click the error line use of undeclared identifier 'vsnprintf' in the Logs tab
  • Logging.cpp from Hermes will open
  • Comment everything inside the function
  • Rebuild the app

@okwasniewski
Copy link
Member

The fix is coming: facebook/hermes#1358

@okwasniewski okwasniewski changed the title Can't build a new project for dev [Hermes] Can't build a new project for dev Apr 24, 2024
@okwasniewski
Copy link
Member

I'm disabling Hermes by default until the above PR gets merged. If you still want to use Hermes remove :hermes_enabled => false from visionos/Podfile. And do what @thiagobrez explained above. The fix should land shortly.

@matthargett
Copy link
Collaborator

upstream PR merged, so this can be revisited for the next release of react-native-visionos

@okwasniewski
Copy link
Member

Hey,

This issue should now be resolved in React Native 0.74.3. Backport to 0.73.x will be available once this PR get's merged: facebook/hermes#1432

@bgazzera
Copy link

bgazzera commented Jul 4, 2024

For others who may also experience this error, we also came across this issue while using CMake version 3.28.0, recommended in the README.md.

Commenting out Hermes / Adding libReact-hermes.a didn't work for us.
Fixed by updating CMake to 3.29.9 or 3.30.0

@okwasniewski if it helps, I can submit a PR to update the README and also the docs repo. And thanks for all your work, great stuff.

@okwasniewski
Copy link
Member

For others who may also experience this error, we also came across this issue while using CMake version 3.28.0, recommended in the README.md.

Commenting out Hermes / Adding libReact-hermes.a didn't work for us.

Fixed by updating CMake to 3.29.9 or 3.30.0

@okwasniewski if it helps, I can submit a PR to update the README and also the docs repo. And thanks for all your work, great stuff.

It would be great if you could create a PR, I forgot to update it.

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

No branches or pull requests

9 participants