18

I have a cleanly installed Mac 10.15.7, with freshly installed xCode (12.4) on in it. I installed react-native following the official instructions here. I created a new project and tried to build it (from Xcode), but ended up with this error:

Lexical or Preprocessor Issue - event2/event-config.h file not found

Error Message

It appears to have something to do with Flipper. I have absolutely no clue how to fix this, as I am not familiar with CPP development and the file/data-structure it needs...

four-eyes
  • 10,740
  • 29
  • 111
  • 220
  • How is this related to JavaScript when a c/c++ header file is missing? – Andreas Feb 09 '21 at 11:30
  • @Andreas Because React-Native is a JS library and maybe some other JS developers encountered the same problem when writing RN apps. – four-eyes Feb 09 '21 at 11:32

3 Answers3

44

That's because there is a new version of Flipper and React Native might not come with the right one so best is to go in your podfile and add this use_flipper!({ 'Flipper' => '0.74.0' }) then run pod install

Markus Hayner
  • 2,869
  • 2
  • 28
  • 60
  • 2
    Works great. Specifically, i replaced the "use_flipper!" (which was defaulting to '0.54.0') to "use_flipper!({ 'Flipper' => '0.74.0' })" – cy-c Mar 11 '21 at 03:22
  • Better get latest version using "npm info flipper" so you can put the right version on podfile You may need to do "pod repo update" – Can Dec 18 '21 at 17:43
4

SOLVED:

First i tried to add use_flipper!({ 'Flipper' => '0.74.0' }) But it didnt solve my error then i commented out this like like # use_flipper!({ 'Flipper' => '0.74.0' }) and run pod install it started working.

Honestly don't know how :)

Ali Akram
  • 4,803
  • 3
  • 29
  • 38
  • Did you run `pod install` after specifying Flipper's version? If not, that's the problem. When you commented out `use_fliper...` and then ran pod install it removed the problematic version of flipper and your project was able to build. – Ivanka Todorova Jan 21 '22 at 15:54
1

You need to get the latest version of Flipper SDK, from here: https://fbflipper.com/docs/getting-started/react-native/

For example: use_flipper!({ 'Flipper' => '0.78.0' }) then run pod install in the ios directory.

This fixed it for me.

jonnyn
  • 31
  • 2