. Advertisement .
..3..
. Advertisement .
..4..
When attempting to complete your task, you receive the following error: “‘event2/event-config.h’ file not found in React-Native“. This is one of the most wide-known errors that any programmer will make. So, why does it appear, and how can it be resolved? We’ll go over it with you.
Why Does The Error “‘event2/event-config.h’ file not found in React-Native” Occur?
You are attempting to build for iOS in react-native, but the build failed due to this error. And you are working with react-native v0.63.4. We believe it is a Flipper problem. When we commented out, use the flipper! in the Podfile, we were able to build again.
'event2/event-config.h' file not found
The Best Methods To Solve ”‘event2/event-config.h’ file not found in React-Native” error
And guess what, we have just solved it using the two methods listed below.
Method 1: Make sure to use the newest version
It’s a flipper SDK problem. Facebook has just released v74 of Flipper, which includes support for arm64 devices. You need to be sure that you are using the latest version.
- Android:In android/gradle.properties, increase the FLIPPER VERSION variable, for example, FLIPPER VERSION=0.74.0. In the android directory, execute./gradlew clean.
- iOS:In iOS/Podfile, call use flipper with a specific version, for example: use flipper!( ‘Flipper’ => ‘0.74.0’ ). In the ios directory, run pod install.
- Here’s how to set up a flipper for react-native: React Native App – Automatic Setup
If you do not find an issue with the above version, you can resolve the ‘event2/event-config.h’ file.
Method 2: Follow these steps
This problem appears when you update the Xcode version, and this error results in flipper-folly files. Moreover, all solutions with and without the flipper file are defined here. To resolve this error, follow the steps below.
Using Flipper File.
There is only one solution if you require a flipper file. You need to downgrade the flipper version. Change these lines of code in your Podfile in your iOS app project folder.
use_flipper!({ 'Flipper-Folly' => '2.3.0' }) # update this part
post_install do |installer|
flipper_post_install(installer)
end
After that, you’ll have to update our pods. Take the steps outlined below.
pod update
Or
pod install
Also, remember to keep your cocoapods up to date.
sudo gem install cocoapods
Do not use Flipper File.
If you don’t require the flipper file. Then you may comment out the following code. Open your Podfile in your iOS app project folder and comment these lines of code out.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
After that, you’ll have to update our pods. Take the steps outlined below.
pod update
Or
pod install
Also, remember to keep your cocoapods up to date.
sudo gem install cocoapods
Method 3: Remove Flipper module
Beside the above solutions, removing the Flipper
module is a great solution to solve “‘event2/event-config.h’ file not found in React-Native” error. All you need to do is removing or commenting the below lines in Podfile
file. In the case the AppDelegate.m
file has any code associated with Flipper
, you also have to exclude or comment it. Look at the following example to understand more about this method.
# add_flipper_pods!
# post_install do |installer|
# flipper_post_install(installer)
# end
Method 4: Update Flipper-Folly version
If you want to keep the Flipper
module, let’s update the version of Flipper-Folly
, for instance, upgrade to 2.3.0 as the below:
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
- use_flipper!
+ use_flipper!({ 'Flipper-Folly' => '2.3.0' }) # update this part
post_install do |installer|
flipper_post_install(installer)
end
The error “‘event2/event-config.h’ file not found in React-Native” will be solved.
Conclusion
For individuals who are still confused by this error: “‘event2/event-config.h’ file not found in React-Native” the solutions listed above are the quickest. If you still need help or have general complex questions, we have a thriving community where everyone is always willing to help. Finally, we wish you a successful day filled with new solutions and code.
Leave a comment