Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCTPushNotificationManager.h:8:9: fatal error: 'React/RCTEventEmitter.h' file not found #1144

Closed
stevenleeg opened this issue Jul 23, 2019 · 7 comments
Labels

Comments

@stevenleeg
Copy link

Hi there,

After manually linking react-native-push-notification as per the documentation I've found myself running into this issue on a freshly init'd React Native project:

In file included from [...]/node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.m:8:
[...]/node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h:8:9: fatal error: 'React/RCTEventEmitter.h' file not found
#import <React/RCTEventEmitter.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command Analyze failed with a nonzero exit code

Any ideas as to what might be causing this? I've seen the issue arise from a few other projects, along with a similar report from this project in this stack overflow question.

@stevenleeg
Copy link
Author

Looks like this Stack Overflow question solves the issue.

The trick, as mentioned by Chris in the comments of the SO question is to add the following to your Podfile:

pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS'

It looks like this might be something new to React .60; should these instructions perhaps be in the README?

@ThibaultJanBeyer
Copy link

@stevenleeg after adding those lines, the RTC is gone, but I get:

…
ld: 5 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


** BUILD FAILED **


The following build commands failed:
        Ld /Users/tjb/Library/Developer/Xcode/DerivedData/build/Build/Products/Debug-iphonesimulator/tinycarebot.app/tinycarebot normal x86_64
(1 failure)

:(

@ThibaultJanBeyer
Copy link

Here is what worked for me:

Copy RCTPushNotificationManager.h manually into React-Core like this:

In the root folder of your project:

cp ./node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h ./ios/Pods/Headers/Public/React-Core/React

Don’t know if that is a good solution. Maybe if someone could explain me why it was not in there in the first place? I followed the setup instructions 1 by 1 very carefully doing everything right… Thank you

@Jordanwmk
Copy link

Jordanwmk commented Jul 31, 2019

I've spent some time on this and found out that after adding
pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS'
in the podfile as mentioned by stevenleeg, I also had to remove libRCTPushNotification.a from Link Binary With Libraries

Maybe someone else can confirm if this works for them as well?

@annie-elequin
Copy link

I can confirm @Jordanwmk that in a newly init'd RN app, I followed all the same steps from the README in addition to adding the line in the podfile EXCEPT I avoided adding libRCTPushNotification.a to Link Binary With Libraries.

After doing this the app successfully built. I haven't tested the notifications yet but the building successfully is farther than I've gotten so far haha.

@er-nabin-bhusal
Copy link

Add this to the Podfile
pod 'React-RCTPushNotification', :path => '../node_modules/react-native/Libraries/PushNotificationIOS'
This fixed my problem.

@github-actions
Copy link

github-actions bot commented Nov 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 4, 2020
@github-actions github-actions bot closed this as completed Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants