react-native: [iOS] [0.68.0-rc.4] 'react/config/ReactNativeConfig.h' file not found
Description
When running the latest RC via iOS using the new architecture, I am running into the following error:
/Users/alex/Documents/Projects/DemoFabricProject/node_modules/react-native/ReactCommon/react/renderer/scheduler/Scheduler.h:14:10: ‘react/config/ReactNativeConfig.h’ file not found
#include <react/config/ReactNativeConfig.h>
Version
0.68.0-rc.4
Output of npx react-native info
System: OS: macOS 12.3 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 1.45 GB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 3.2.0 - ~/.yarn/bin/yarn npm: 8.5.0 - /usr/local/bin/npm Watchman: 2022.03.21.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/alex/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 28, 30, 31, 32 Build Tools: 29.0.2, 30.0.2, 30.0.3, 32.0.0 System Images: android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64, android-32 | Google Play Intel x86 Atom_64 Android NDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 11.0.14.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: Not Found react-native: Not Found react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Install project using 0.68.0-rc.4 and follow the steps provided by the upgrade helper.
Snack, code example, screenshot, or link to a repository
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 39 (8 by maintainers)
I removed my
ios/build/
andios/Pods/
, rebuilt everything, and it now compiles with RN 0.68.0. @AlexanderEggers have you tried this?@baveku I’ll try to explain how I solved my issue with this error:
Reading the react-native-config documentation I just realised Apple changed the way we have to import libraries in AppDelegate.m
So what I did was:
Replace #import “ReactNativeConfig.h” for #import “RNCConfig.h” Don’t forget to update the whole file by changing ReactNativeConfig for RNCConfig
Happy coding 😃
I am seeing a similar issue:
I have this issue in 0.68.2
yes, Reanimated v2 not support new Architecture, We need to wait for Reanimated release v3, Maybe next month, we can use it. Announcing Reanimated 3
Thanks Your. suggestion works for me.
The content of
project.pbxproj
was the culprit, i just initialise a new react-native project and copiedproject.pbxproj
into the existing project and the build works.Reanimated 3.0.0-rc.0 supports all features of Reanimated 2 except for Layout Animations.
See this comment for more details:
TL;DR We will release 3.0.0 (stable) once we add Layout Animations for Fabric.
Can anyone post diffs of their project files?
Cannot build ios app with v0.68 on with or without New Architecture Enabled.
I have had patience for many days trying diff methods but still was not able to fix any and had to come up here and report.
@baveku Yep I am using that - might indeed be related to that. Regarding reanimated generally, the PR https://github.com/facebook/react-native/commit/58a2eb7f37c2dc27ad3575618778ad5b23599b27 would unblock the new architecture for reanimated which is planned for 0.68.1. But I think reanimated generally needs to add support to the new architecture first anyway. It is strange that
fatal error: 'react/config/ReactNativeConfig.h' file not found
would be thrown in this case - seems strange to me.I was having a similar issue after enabling and disabling :fabric_enabled but this fixed it for me
Reanimated 2 does not support Fabric (the new architecture). You need to use Reanimated 3.0.0-rc.10 (or newer).
Hey all! In order to use Reanimated with Fabric enabled, you must first update to 0.69+.
Reanimated 3.0.0-rc.0 with Fabric enabled does not support React Native 0.68.x.
For more details, check out the comment on the issue in Reanimated repo:
same issue, I can’t build my project when upgrade to 0.68
I clean all cache, build, node_modules, Pods, and reinstall it. But still issue, hope we can fix it soon.
I see 3.0.2 version already available
Changing all
AppDelegate.m
intoAppDelegate.mm
insideproject.pbxproj
(a file with temptation not to look into) worked for me.I was about to give up all hope, until I did this. Thanks you sir!
I have this issue and I have resolve it, with just this command,
npx react-native-clean-project
I have no idea what this pkg cleanup but now my project is able to run on iOS & android both with the latest version of react native@0.68.2.I was able to build the same way. Created new project. Opened in xcode beside my project and compared settings. Now it builds.
@AlexanderEggers I found something in Reanimated, I can’t build if we have Reanimated. Do you use Reanimated in your app?