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)

Most upvoted comments

I removed my ios/build/ and ios/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:

  • 3.0.2 version in react-native-reanimated didn’t help

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:

❌  /Users/renchap/dev/project/packages/mobile/ios/Pods/Headers/Private/React-Codegen/react/renderer/components/rncore/EventEmitters.h:12:10: 'react/renderer/components/view/ViewEventEmitter.h' file not found

#include <react/renderer/components/view/ViewEventEmitter.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Closing as this has been reported as fixed + this issue was related to a RC version of RN. We now released 0.68.2 stable.

I have this issue in 0.68.2

I’m also getting the same issue: Screenshot 2022-05-23 at 12 11 09 PM

seems like it’s related to react-native-reanimated “react-native-reanimated”: “^2.8.0”, “react-native”: “^0.68.1”,

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

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. Screenshot 2022-04-06 at 13 37 51

Yes i have the same problem, so I make new project on New Template without follow migrate doc in reactnative.dev and replace file in AppDelegate.mm and reinstall all package, It’s work, you can replace new Appdelegate.mm to fix it 😉

Thanks Your. suggestion works for me.

The content of project.pbxproj was the culprit, i just initialise a new react-native project and copied project.pbxproj into the existing project and the build works.

When does Reanimated 3 release? I saw Reanimated 3 rc0 a long time

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.

Screenshot 2022-04-06 at 13 37 51

@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 removed my ios/build/ and ios/Pods/, rebuilt everything, and it now compiles with RN 0.68.0. @AlexanderEggers have you tried this?

I was having a similar issue after enabling and disabling :fabric_enabled but this fixed it for me

@tomekzaw yes I am - I’m running my pod install commands like RCT_NEW_ARCH_ENABLED=1 bundle exec pod install as per the documentation

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

 fatal error: 'react/config/ReactNativeConfig.h' file not found

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 into AppDelegate.mm inside project.pbxproj (a file with temptation not to look into) worked for me.

I removed my ios/build/ and ios/Pods/, rebuilt everything, and it now compiles with RN 0.68.0. @AlexanderEggers have you tried this?

I was about to give up all hope, until I did this. Thanks you sir!

Same error with me too: I tried other solutions too, but there is not third-party folder exist. here is the error I guess:

ios/Pods/glog/src/base/mutex.h:105:10: fatal error: 'config.h' file not found
#include "config.h"           // to figure out pthreads support
         ^~~~~~~~~~

Here is my current configuration:

System:
    OS: macOS 12.4
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Memory: 50.68 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.10.0 - /usr/local/bin/npm
    Watchman: 2022.06.13.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8512546
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

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.

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. Screenshot 2022-04-06 at 13 37 51

Yes i have the same problem, so I make new project on New Template without follow migrate doc in reactnative.dev and replace file in AppDelegate.mm and reinstall all package, It’s work, you can replace new Appdelegate.mm to fix it 😉

Thanks Your. suggestion works for me.

The content of project.pbxproj was the culprit, i just initialise a new react-native project and copied project.pbxproj into the existing project and the build works.

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?