React-native-intercom: 'React/RCTBridge.h' file not found when trying to compile IntercomEventEmitter.m

Created on 29 Aug 2019  路  9Comments  路  Source: tinycreative/react-native-intercom

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.

All 9 comments

Really need a fix for this.

I'm also having the same problem

@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.

@lucasharada could you give more information on how you got it working? Which version of RN are you using? Which versions of react-native-intercom and intercom are you using?

@waclock I installed Intercom using Cocoapods (added pod 'Intercom' to Podfile) and didn't add the pod 'react-native-intercom', :path => '../node_modules/react-native-intercom' line from the Podfile.

When building, I changed the Build settings of the RNIntercom project on Xcode, making the Header Search Path points to the header files from the Pods/Headers/Public/React folder.

Hope it helps you.

Library | Versions
---- | -----
RN | Expo SDK 32.0.0 (RN 0.57)
react-native-intercom | 12.5.1
Intercom | 5.4.1

PS: My project was ejected from Expo, but I don't think this matters too much on the issue.

iam having same issue upgraded to RN 0.61 and having same issue

@hamoudaarfaoui Your issue is probably related to the autolinking feature added in RN 0.60.

it was CocoaPods issue , i had to update react-native-intercom.podspec and replace s.dependency 'React/Core' with s.dependency 'React-Core' that solved the problem for me, how did you solve it ? because i will run into the problem again if i reinstall the package somehow .

  • RN0.61
  • Intercom : 10.2.0

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"])

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skleest picture skleest  路  8Comments

nirpeled picture nirpeled  路  6Comments

mrharel picture mrharel  路  4Comments

canpoyrazoglu picture canpoyrazoglu  路  3Comments

AlmogRnD picture AlmogRnD  路  10Comments