callstack / react-native-visionos

A framework for building native visionOS applications using React
https://callstack.github.io/react-native-visionos-docs/
MIT License
1.02k stars 30 forks source link

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

Closed bartlomein closed 5 months ago

bartlomein commented 8 months ago

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 commented 8 months ago

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

bartlomein commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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

jariwalabhavesh commented 8 months ago

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

okwasniewski commented 8 months ago

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

15bedirhan commented 8 months ago

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

Screenshot 2024-03-27 at 15 05 50
okwasniewski commented 8 months ago

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

15bedirhan commented 8 months ago

@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 commented 7 months ago

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 commented 7 months ago

Workaround for now:

okwasniewski commented 7 months ago

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

okwasniewski commented 7 months ago

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 commented 6 months ago

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

okwasniewski commented 5 months ago

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

bgazzera commented 5 months ago

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 commented 5 months ago

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.