1

I'm following the guide here to create a Native Module in React Native. I selected Swift & Kotlin for the language.

https://reactnative.dev/docs/native-modules-setup

I go through the setup, and it creates two projects. One is an example app and the top level is a library project (AwesomeModule.xcodeproj) for the module. When I open up the iOS library project for the Turbo Module in Xcode I get this errors.

'React/RCTBridgeModule.h' file not found

Here is a screenshot of that directory. It just generates a project file without a workspace.

enter image description here

How do I generate a Workspace in this library project so I can run it independently of the example project?

Berry Blue
  • 15,330
  • 18
  • 62
  • 113
  • 1
    are you trying to open `xcodeproj` file? I believe you should be opening `xcworkspace` – timbre timbre Oct 14 '22 at 20:38
  • 1
    There's no workspace generated with the native module project. I added a screenshot. – Berry Blue Oct 14 '22 at 22:19
  • 1
    There are so many reasons for this error really. For example look at this thread: https://stackoverflow.com/questions/41663002/react-rctbridgemodule-h-file-not-found - at least 4-5 different reasons. So without further details / debug details, nobody will be able to help you. – timbre timbre Oct 16 '22 at 15:40
  • 1
    The problem I'm having is most of these solutions and suggestions are from several years ago. This should be easily reproducible. I tried on multiple machines with the steps in my post and I get the same results. – Berry Blue Oct 16 '22 at 16:22

1 Answers1

3

for making a library, we don't need to make xcworkspace separately for a library or native modules, for pod support in your library or native modules you can use project_root/project.podspec

I would suggest using react-native-builder-bob for creating native turbo modules with an example folder. it is easy to use

npx create-react-native-library@latest react-native-awesome-library

enter image description here

Muhammad Numan
  • 23,222
  • 6
  • 63
  • 80