question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RCTBridgeModule.h file not found

See original GitHub issue

Hi, 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:open
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

5reactions
abcd-cacommented, Jan 23, 2017

I managed to get it to build. My OAuthManager.h imports look like this:

#import "RCTBridgeModule.h"
#import "RCTLinkingManager.h"

My header search paths look like this:

$(SRCROOT)/../node_modules/react-native/React                                           (recursive)
$(SRCROOT)/../node_modules/react-native-oauth/ios/OAuthManager          (non-recursive)
$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS                   (non-recursive)

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.

2reactions
SekibOmaziccommented, Jan 23, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`React/RCTBridgeModule.h` file not found - Stack Overflow
I solved this issue by dragging React. xcodeproj found in /node_modules/react-native/React to my root directory in Xcode, then added React as a ...
Read more >
[iOS - RN 0.61.1 migration] React/RCTBridgeModule.h file not ...
When you go to scheme -> edit scheme -> build. Do you have see React (missing) ? If so, i might have a...
Read more >
[Solved]-`React/RCTBridgeModule.h` file not found-Reactjs
In my case this particular problem happened when I was trying to archive a 0.40+ react-native app for iOS (solution was found here:...
Read more >
Fatal error: 'React/RCTBridgeModule.h' file not found
Hi Team, I am getting this error( fatal error: 'React/RCTBridgeModule.h' file not found #import “React/RCTBridgeModule.h”) while building ...
Read more >
Ios – Build failed 'React/RCTBridgeModule.h' file not found
Ios – Build failed 'React/RCTBridgeModule.h' file not found. cocoapodsiosreact-nativexcode. I spent my day trying to fix my problem, I tried every solution ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found