React-native-intercom: 'React/RCTEventEmitter.h' file not found

Created on 31 Jan 2017  ·  39Comments  ·  Source: tinycreative/react-native-intercom

guys,

first of all, thank you for the awesome job!

I have a small problem though: I am developing an IOS app and I struggle with this for hours now.
When I build project in xCode I get the following:
image

Any idea why does it happen? Thank you!

Most helpful comment

screen shot 2017-01-31 at 4 54 52 pm

same result after update @browniefed

All 39 comments

sorry guys,

has nothing to do with the package. The xcode was misconfigured.

I am closing the issue

How did you resolve this @petromoldovan? I am facing the same issue

This may have been due to some recent changes in removing some of the header paths from the library. I will get a potential fix out for this later.

thanks @browniefed. Do you know of a timeline, or even better, can you provide the potential fix?

v5.3 has been published with the paths added back and compatibility with react-native .40 and before.
The previous version would only support .40

@mmckinley8

@browniefed terrific! I'll let you know if I have issues...I figured it was something related to 0.40.0 because of the new import syntax for iOS - reason I have not upgraded yet

screen shot 2017-01-31 at 4 54 52 pm

same result after update @browniefed

Sorry, I'm not sure then. Maybe @petromoldovan can clarify.

I'm guessing it's a header search path issue.

I may also recommend install older versions. If you can find where the error occurs I can narrow it down.

@browniefed @mmckinley8 I am on RN 0.40.0.

the way I "solved" it was to start over. When installing the package I followed so many advices from different sources that I misconfigured something in the xcode. It would not build. So I pulled a project again and gave it fresh start in xcode.

I made it work like this:

1. npm install react-native-intercom --save
2. react-native link
3. Setup manually libs
https://github.com/intercom/intercom-ios
Add run Script like this:
http://runscriptbuildphase.com/

4. Add config
IOS
Add in AppDelegate.m

#import "Intercom/intercom.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [Intercom setApiKey:@"YOUR_KEY" forAppId:@"YOU_APP_ID"];
}

5. Render

var Intercom = require('react-native-intercom');
Intercom.registerIdentifiedUser({ userId: 'bob' });
Intercom.displayMessageComposer();

hope this helps!

I created a fresh react-native project using 0.40.0, and still received errors when compiling iOS. I have already successfully integrated android. I am receiving the same error referenced in https://github.com/tinycreative/react-native-intercom/issues/58 but for iOS. I also attempted @petromoldovan steps, but no luck :(. @browniefed I have seen the updates and appreciate the effort. I will reattempt once RN 0.41.0 is released.

@mmckinley8 can you step backwards in version and find out if there is a version that works for you?

@browniefed I went all the way back to 4.1, this resulted in errors also. I believe it was a React dependency issue for 4.1. I also tried 4.2, 4.4, and 5.1.

I'll do my best to get something work and if I do I can record a screencast and let you know. Sorry, I'm just not sure what your issues are

No worries at all. Appreciate the responsiveness and effort.

I think the fix is to import headers like:

// import RCTEventEmitter.h
#if __has_include("RCTEventEmitter.h")
#import "RCTEventEmitter.h"
#elif __has_include(<React/RCTEventEmitter.h>)
#import <React/RCTEventEmitter.h>
#else
#import "React/RCTEventEmitter.h"
#endif

Otherwise, i'm not sure it's possible to remain backwards compatible with older version of React, and also support CocoaPods :/

Ahhhhh I see, it's a potential cocoapods issue.

Thanks @lelandrichardson (totally forgot when linking to other topics it shows up on that thread haha)

@lelandrichardson I have tried your solution but still doesn't work. I'm on [email protected]
I'still getting the RCTEventEmitter not found error

I also tried
`#if __has_include()

import

else // back compatibility for RN version < 0.40

import "RCTEventEmitter.h"

endif`

looking at my original comment, I think the ordering i typically use now is:

#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#elif __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#else
#import "React/RCTBridgeModule.h"
#endif

I'm not sure if that will make any difference for you or not...

He got it fixed, was an issue with xcode on a separate issue. I'll fix the
code to be that. Thanks Leland

On Mar 28, 2017 5:43 PM, "Leland Richardson" notifications@github.com
wrote:

looking at my original comment, I think the ordering i typically use now
is:

if __has_include()

import

elif __has_include("RCTBridgeModule.h")

import "RCTBridgeModule.h"

else

import "React/RCTBridgeModule.h"

endif

I'm not sure if that will make any difference for you or not...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tinycreative/react-native-intercom/issues/65#issuecomment-289947944,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABop8Yf2DONXQEKyhRlTbZdwXt7UpsIOks5rqak6gaJpZM4Lyidy
.

I have run into the same issue as @mmckinley8 today, are there any news how to fix it?
Im using [email protected] and [email protected]

Basically it says that RCTBridgeModue.h is not found and also that RCTEventEmitter.h is missing.

I have similar problems.

"react-native": "0.44.2 ",
"react-native-intercom": "5.7.0", // use old one due to the other problem with Android SDK APIs version

Any ideas what we should do?

At first, I had manual installation and the "strip-frameworks" script failed (non-existed)
Then I added these in the podfile and updated:
pod 'Intercom'
pod 'react-native-intercom', :path => '../node_modules/react-native-intercom'

So, now, after the pod logic, I have the 'React/RCTEventEmitter.h' file not found issue.

This issue is still happening:
"react-native": "0.45.1"
"react-native-intercom": "6.2.0"

Installation guide is not correct!

@kwnccc try starting a new RN project and follow my instruction. I checked it few times already. It must be working.

Happening here too

[email protected]
[email protected]

It's working (without notifications) on Android but not on iOS.

Anyone who have succeeded installing on React Native >= 44?

Unable to build with [email protected] and [email protected]...

👍

👍

I solved my problem by adding the following entries to Intercom Build Target > header search paths:

../../../ios/Pods/Headers/Public
../../../ios/Pods/Headers/Public/React (recursive)

screen shot 2017-08-04 at 10 46 09

I am having the same issue, how can this be solved?

Same

I got it working, it looks like it was unable to find all needed React headers from the include dir

@maartenvandillen what did you add to you header search path to get it work?
Thank you

@StefanoCremona I can't remember. I have since then changed the way Intercom is integrated into the project. I am now using

pod 'Intercom', '> 3'

successfully instead

Anyone tried it with RN 0.61.5 & react-native-intercom 16.0.0? I'm stuck with this same error for 3 days.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlmogRnD picture AlmogRnD  ·  7Comments

AlmogRnD picture AlmogRnD  ·  10Comments

klamping picture klamping  ·  11Comments

forsen picture forsen  ·  5Comments

lucasharada picture lucasharada  ·  9Comments