'React/RCTBridge.h' file not found when trying to compile IntercomEventEmitter.m

See original GitHub issue

I’m trying to include react-native-intercom on my app. My app was built on Expo and was later ejected to allow installing react-native-intercom.

On my latest try, I went with CocoaPods. After installing, I managed to add @import Intercom; on top of AppDelegate.m file and also included the

[Intercom setApiKey:@"{apiKey}" forAppId:@"{appId}"];

inside the didFinishLaunchingWithOptions function. Before including react-native-intercom, I tried to build to check if everything was correct and it built perfectly. Then I proceeded to add react-native-intercom

yarn add react-native-intercom
react-native link react-native-intercom

and added RNIntercom.xcodeproj to the root of the project and linked libRNIntercom.a into the Build Phases configuration.

When trying to build, the following error pops up:

In file included from {project_path}/node_modules/react-native-intercom/iOS/IntercomEventEmitter.m:9:
In file included from {project_path}/node_modules/react-native-intercom/iOS/IntercomEventEmitter.h:12:
../../react-native/React/Modules/RCTEventEmitter.h:8:9: fatal error: 'React/RCTBridge.h' file not found
#import <React/RCTBridge.h>
        ^~~~~~~~~~~~~~~~~~~
1 error generated.

Any hint on how to fix this issue? Thanks in advance.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:9

github_iconTop GitHub Comments

2reactions
lucasharadacommented, Sep 9, 2019

@maxKimoby @misterpoloy I managed to build using a previous version of both react-native-intercom and intercom itself after changing the Build settings of the RNIntercom project on Xcode. I’m not sure if it can be done with current versions also, as I didn’t upgrade them after getting it to build properly.

The steps I took was to point the Header Search Path to get the header files from the Pods/Headers/Public/React folder. Didn’t test for Android.

1reaction
elisechantcommented, Mar 31, 2021

I solved this by installing Intercom as a Cocoapod instead of relying on the pod within react-native-intercom (as it has the issue).

My fix was to add the same version of Intercom above the autolink in the Podfile:

pod 'Intercom', '8.1.1'
use_react_native!(:path => config["reactNativePath"])
Read more comments on GitHub >

github_iconTop Results From Across the Web

`React/RCTBridgeModule.h` file not found - Stack Overflow
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 >
React Native: How to fixed RCTBridgeModule.h file not found
React Native: How to fixed RCTBridgeModule. h file not found. 19K views 3 years ago. AppSolution. AppSolution. 126 subscribers. Subscribe.
Read more >
iOS : Build failed 'React/RCTBridgeModule.h' file not found
iOS : Build failed 'React/RCTBridgeModule. h ' file not found [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] iOS ...
Read more >
[Solved]-`React/RCTBridgeModule.h` file not found-Reactjs
What happened was that Xcode was trying to build the react-native libraries in parallel and was building libraries with implicit react dependencies before ......
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 >

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