I have a react-native project that has two requirements. It needs to work with Airbnb's native-navigation library and it requires a Realm database. I'm having a time getting the two libraries to work togeather. Because Native-navigation uses Swift files, it requires that react-native, and other native libraries are installed through cocoapods.
Realm, is not a cocoapod friendly library so I have been following this basic setup where I start with airbnb's boilerplate ReactNativeStarter
. At this point the project builds and runs but when I introduce Realm I get an error when I build the project that it can't find React header files.
Here are my steps:
1) Install realm through npm install --save realm
2) Dig into /node_modules/realm/react-native/ios/
and drag RealmReact.xcodeproj
into the boilerplate generated ReactNativeStarter
project within the ReactNativeStarter.xcworkspace
file
3) I then add to the following to the header search path for Realm React $(SRCROOT)/../../../../ios/Pods/Headers/Public
I think it's worth noting that the /Pods/Headers folder contains nothing. Is this possibly an issue with cocoapods not generating the header files for React properly?
4) I add libRealmReact.a
static library under 'Linked Frameworks and Libraries'
5) Finally, I add $(SRCROOT)/../node_modules/realm/src
to the header search paths for ReactNativeStarter project.
Problem - At this point building the project still results in the following xcode build error:
/Users/some.guy/ReactNative/SaveAs/node_modules/react-native/React/Base/RCTBridge.h:12:9: 'React/RCTBridgeModule.h' file not found