react-native-visionos icon indicating copy to clipboard operation
react-native-visionos copied to clipboard

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

Open bartlomein opened this issue 1 year ago • 16 comments

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

bartlomein avatar Mar 09 '24 19:03 bartlomein

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

okwasniewski avatar Mar 09 '24 20:03 okwasniewski

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 avatar Mar 10 '24 19:03 bartlomein

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

bartlomein avatar Mar 10 '24 19:03 bartlomein

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 avatar Mar 11 '24 07:03 josh-deprogram

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,

josh-deprogram avatar Mar 11 '24 11:03 josh-deprogram

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

robertherber avatar Mar 12 '24 11:03 robertherber

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

jariwalabhavesh avatar Mar 19 '24 18:03 jariwalabhavesh

Can you guys try out RC release? https://github.com/callstack/react-native-visionos/releases/tag/v0.74.0-rc.0-visionos

okwasniewski avatar Mar 20 '24 14:03 okwasniewski

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

Screenshot 2024-03-27 at 15 05 50

15bedirhan avatar Mar 27 '24 12:03 15bedirhan

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

okwasniewski avatar Mar 27 '24 12:03 okwasniewski

@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

15bedirhan avatar Mar 27 '24 12:03 15bedirhan

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.

okwasniewski avatar Apr 12 '24 07:04 okwasniewski

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

thiagobrez avatar Apr 12 '24 09:04 thiagobrez

The fix is coming: https://github.com/facebook/hermes/pull/1358

okwasniewski avatar Apr 18 '24 13:04 okwasniewski

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.

okwasniewski avatar Apr 24 '24 12:04 okwasniewski

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

matthargett avatar May 10 '24 00:05 matthargett

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: https://github.com/facebook/hermes/pull/1432

okwasniewski avatar Jun 10 '24 12:06 okwasniewski

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.

bgazzera avatar Jul 04 '24 12:07 bgazzera

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.

okwasniewski avatar Jul 04 '24 12:07 okwasniewski