realm-js: iOS build error: realm-js-ios/jsc_init.h file not found

Goals

Successfully build on iOS device using Realm version 10.3.0 after upgrading from version 10.1.4

Expected Results

No errors when building on an iOS device.

Actual Results

When compiling/building in XCode, the build fails with the message:

node_modules/realm/react-native/ios/RealmReact/RealmReact.mm:22:9: fatal error: 'realm-js-ios/jsc_init.h' file not found

Steps to Reproduce

  1. Upgrade realm from version 10.4.1 to 10.3.0 using yarn: yarn upgrade realm@latest
  2. Run pod install with --repo-update flag in ios directory: pod install --repo-update
  3. Open XCode, plug iOS device into Mac, and start the build

Code Sample

N/A

Version of Realm and Tooling

  • Realm JS SDK Version: 10.3.0
  • Node or React Native: React Native 0.63.4
  • Client OS & Version: iOS 14.4
  • Which debugger for React Native: None

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 29 (10 by maintainers)

Most upvoted comments

Hey @Joshfindit, thanks for reporting this! It looks like we may have accidentally set realm@10.19.0-alpha.0 as the default npm version, we will fix this now, but in the meantime could you please try using the latest stable version, npm i realm@10.17.0?

Thanks and sorry for the inconvenience!

@tomduncalf That did fix it, thank you

If you’re open to it I’d also suggest a CI test based on the very basic steps from my report. It would likely make sure that this issue does not reappear.

The npm issue should now be fixed @Joshfindit. Thanks again for reporting!

I am facing the same issue with the Realm JS SDK Version: 10.7.0. I tried all the steps provided by @Przytua but had no success. I faced clang: error: linker command failed with exit code 1 (use -v to see invocation) for librealm-js-ios.a

A minimum CocoaPods version has been added to the docs (1.10.1) : https://docs.mongodb.com/realm/sdk/react-native/install/ - and I’ll discuss with the team, if prerequisites shouldn’t just be listed in the readme.

Just to sum up: Update CocoaPods to version 1.10.1 (thanks again to @Przytua).

Thank you for sharing @Przytua 🙏

@kneth tried without --repo-update and as others have said, still seeing the same issue.

@kneth I also experiencing the same issue without -repo-update

@kneth I’m also experiencing this issue and with or without the —repo-update flag makes no difference, at least in my situation.