RCTBridgeModule.h file not found
See original GitHub issueHi, I have a RN project v0.40.0. I’ve installed Firestack and that recommends I use react-native-oauth. After linking and installing pods, I get the build error, 'RCTBridgeModule.h' file not found
in OAuthManager.h
.
I have tried replacing,
#import "RCTBridgeModule.h"
with,
#import <React/RCTBridgeModule.h>
Which seems to get rid of the original error but then I get, 'RCTLinkingManager.h' file not found
. Doing,
#import <React/RCTLinkingManager.h>
but that results in,
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_OAuthManager", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also tried leaving the #import "RCTLinkingManager.h"
as is and added the following search paths as has been suggested on stackoverflow:
$(SRCROOT)/../node_modules/react-native-oauth/ios/OAuthManager
$(SRCROOT)/../node_modules/react-native/Libraries (recursive)
The first one fixes another error but I got the same Undefined symbols for architecture i386...
error, presumably about the #import "RCTLinkingManager.h"
Here is my cocoapods file, in case it helps you spot something:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'myproject' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for myproject
target 'myprojectTests' do
inherit! :search_paths
# Pods for testing
end
end
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, '8.0'
[
'Firebase',
'Firebase/Core',
'Firebase/Auth',
'Firebase/Storage',
'Firebase/Database',
'Firebase/RemoteConfig',
'Firebase/Messaging'
].each do |lib|
pod lib
pod 'DCTAuth', :git => 'https://github.com/danielctull/DCTAuth.git'
end
Note, I’m not very familiar with Cocoapods yet but it kept saying that a podfile already exists and I didn’t know if I should elect to overwrite it or not. I ended up merging the firestack one with this oauth one and added in that DCTAuth line above, hope it’s right. pod install
seemed to work but also gave me a yellow warning in my console,
...target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-myproject/Pods-myproject.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Should I heed this warning?
Thank you
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top GitHub Comments
I managed to get it to build. My OAuthManager.h imports look like this:
My header search paths look like this:
The “Automatically with rnpm” section of the readme didn’t add the
libOAuthManager.a
framework to the linked libraries. I just now, added it manually in XCode as per the RCTLinkingManager section of the readme and was able to build. So I think it was a combination of the two.Had the same issue. You need to add following to the “Header Serach Path” (under Build Settings):
$(SRCROOT)/../node_modules/react-native/React
and make it recursive.