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

Created on 7 Apr 2017  路  21Comments  路  Source: facebook/react-native

Description

  1. Initialized new react native project following the react native getting started.
  2. Encounter failed build with the error within terminal:
    'React/RCTEventEmitter.h' file not found

Reproduction Steps and Sample Code

react-native init AwesomeProject
cd AwesomeProject
react-native run-ios

Result:
fatal error: 'React/RCTEventEmitter.h' file not found

--Running in XCode--
image

Additional Information

  • React Native version: 0.43.2 (latest)
  • Platform: iOS
  • Development Operating System: macOS Sierra v10.12.4 (latest)
  • Dev tools: XCode v8.3.1 (latest)
  • Build Options on Xcode (default)
    image
Locked

Most helpful comment

@hramos I just endup on that thread because I'm facing this issue. It might not be dead

All 21 comments

Same issue.

I confirm I'm gettting it too unfortunately. I'm using React Native 0.43.2 too

EDIT: for me this procedure solved the issue. Very strange heisenbug :|

EDIT 2: the procedure I linked made it possible for me to build the project but archive is still failing :

EDIT 3: I finally managed to make archive work by editing the "scheme" and adding, in order:

  • React
  • RCTLinking
  • RCTActionSheet
  • MyProject

and also I had to disable the "Parallelize Build" option.
I hope this can be useful to someone.

I have seen and done the procedure before. It has not worked for me still :/
I tried adding the scheme in the order you described but it has also not worked.
It seems my RCTLinking is still broken because I still get:
'React/RCTEventEmitter.h' file not found in xcode

I solved this problem yesterday with:

  1. Replace all #import "RCT*.h" with #import <React/RCT*.h>.
  2. Since I have used CocoaPods, my RN native modules in Pods still had errors. I haven't found the solution, so I moved my RN native modules from Pods to project, it works.

Ensure your have unchecked Parallelize Build and removed all react-native related header search paths from all targets.

@guangmingzizai The documentation for Firebase says to use react-native as one of the header search paths. Can you explain why you're removing them?

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos I just endup on that thread because I'm facing this issue. It might not be dead

@debrice that's entirely possible. See my last comment for next steps.

Facing the same issue with the latest version of React Native.

+1

react-native-cli: 2.0.1
react-native: 0.50.3
osx: 10.13.2
xcode: 9.2

Having the same issue, any help would be highly appreciated? Anyone?

react-native-cli: 2.0.1
react-native: 0.52.1
osx: 10.13.2
xcode: 9.2

Same issue on Mac:

react-native-cli: 2.0.1
react-native: 0.52.1

Same issue on mac with Xcode Version 9.2 (9C40b)

Same error, different file!

screen shot 2018-02-01 at 10 28 15 am

This procedure did not work for me.... https://github.com/facebook/react-native/issues/12042#issuecomment-275025960

Also, i've tried the following from this link.... (https://github.com/facebook/react-native/issues/12042#issuecomment-275025960)

To solve the issue, you have to do the following:

In Xcode, go to the project scheme (Product -> Scheme -> Manage Scheme -> double click your project).
Click on the 'Build' option at the left pane.
Uncheck 'Parallelize Build' under Build Options.
Then in Targets section, click '+' button then search for 'React'. Select it and click 'Add'.
'React' should now appear under Targets section. Click and drag it to the top so that it will be the first item in the list (before your project).
Clean the project and build.

However, i could only get to this part where React was grayed out..... :/

screen shot 2018-02-01 at 10 29 27 am

My project is now just dead in the water. :/

react-native-cli: 2.0.1
react-native: 0.50.3
Osx: 10.13.3
Xcode: 9.2

Same issue
react: 16.2.0
react-native:0.53.2
MacOS: 10.13.3
XCode: 9.2

same issue

same issue
any solution yet?

hi there,

fyi: react-native upgrade did the job for me 馃憤

I'm having this issue with React-Native 0.55 and Calabash from the -cal target (while the non -cal target compiles just fine).

I fixed this issue by manually linking RNBackgroundFetch and React to XCode and upgrading my React to 16.4.1.

Still getting the problem with RN 0.55.
Even stranger, the issue doesn't heappen all the time. Sometimes (after desperately re-clicking the archive button) I can get the job done. This only effects the archive function...

I had this crop up when I added react-native-sentry

Was this page helpful?
0 / 5 - 0 ratings