0

Getting following error On creating iOS build in React Native:

FlipperKit issue

Semantic Issue
Use of undeclared identifier 'event'

Lexical or Preprocessor Issue 'event.h' file not found with include: use "quotes" insted

fatal error: 'event2/event-config.h' file not found #include <event2/event-config.h>

warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99.

Using following versions of React Native: 0.63.2, XCode: 13.1

Jai Patel
  • 1
  • 2
  • Does this answer your question? ['event2/event-config.h' file not found](https://stackoverflow.com/questions/66019068/event2-event-config-h-file-not-found) – Satheesh Nov 23 '21 at 04:29
  • @Satheesh, have tried changing flipper versions in Podfile, but it did not help. – Jai Patel Nov 23 '21 at 04:43

1 Answers1

0

I have the same error. After hours, I follow the introduction of https://fbflipper.com/docs/getting-started/react-native-ios/, adding two functions flipper_pods and flipper_post_install to Podfile, finally it works for me.

Podfile

 platform :ios, '9.0'
    ...


def flipper_pods()
    flipperkit_version = '0.147.0' # should match the version of your Flipper client app
    pod 'FlipperKit', '~>' + flipperkit_version, :configuration => 'Debug'
    pod 'FlipperKit/FlipperKitLayoutPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
   pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
   pod 'FlipperKit/FlipperKitUserDefaultsPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
   pod 'FlipperKit/FlipperKitReactPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
 end

def flipper_post_install(installer)
  file_name = Dir.glob("*.xcodeproj")[0]
  app_project = Xcodeproj::Project.open(file_name)
  app_project.native_targets.each do |target|
    target.build_configurations.each do |config|
      cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
      unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
        puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
        cflags << '-DFB_SONARKIT_ENABLED=1'
      end
      config.build_settings['OTHER_CFLAGS'] = cflags
    end
    app_project.save
  end
  installer.pods_project.save
end

target 'your-app-name' do
  ...
  # Replace the existing yoga import with the following (adding modular_headers):
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
  ...
  use_native_modules!

  # For enabling Flipper.
  # Note that if you use_framework!, flipper will not work.
  # Disable these lines if you are doing use_framework!
  flipper_pods()
  post_install do |installer|
    flipper_post_install(installer)
  end
end