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.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

6reactions
stevenleegcommented, Jul 23, 2019

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?

3reactions
Jordanwmkcommented, 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React/RCTEventEmitter.h file not found - Stack Overflow
The issue turns out to be that RCTPushNotification doesn't have the reference to React from Cocoapods file React since Expo manages React in...
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