Using a static framework like Realm with React-Native installed via Cocoapods
I have a react based project that has two requirements. It needs to work with Airbnb's native navigation library and this requires Realm . I have a time when two libraries will work togeather. Since Native-navigation uses Swift files, this requires the cocoapods based react to be installed as well as other native libraries.
Realm is not cocoapod friendly library, so I follow this basic setup where I start with the airbnb template ReactNativeStarter
. At this point, the project builds and runs, but when I type in Realm, I get an error while building the project that cannot find the React header files .
Here are my steps:
1) Set the area acrossnpm install --save realm
2) Go to /node_modules/realm/react-native/ios/
and drag RealmReact.xcodeproj
to template project ReactNativeStarter
in fileReactNativeStarter.xcworkspace
3) Then I add to the next search path title 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 header files for React correctly?
4) I am adding a static library libRealmReact.a
under "Related Structures and Libraries"
5) Finally, I add the $(SRCROOT)/../node_modules/realm/src
ReactNativeStarter project headers to the search paths.
Problem . At this point, project creation still results in the following code build error:
/Users/some.guy/ReactNative/SaveAs/node_modules/react-native/React/Base/RCTBridge.h:12:9: file "React / RCTBridgeModule.h" not found
source to share