react-native-visionos: [Hermes] Can't build a new project for dev

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

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

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.

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

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.

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

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

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