react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[iOS] [0.68.0-rc.4] 'react/config/ReactNativeConfig.h' file not found

Open AlexanderEggers opened this issue 2 years ago • 36 comments

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(R) Core(TM) 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

AlexanderEggers avatar Mar 30 '22 13:03 AlexanderEggers

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>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

renchap avatar Mar 30 '22 16:03 renchap

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

renchap avatar Mar 30 '22 17:03 renchap

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.

baveku avatar Mar 31 '22 18:03 baveku

@AlexanderEggers I found something in Reanimated, I can't build if we have Reanimated. Do you use Reanimated in your app?

baveku avatar Apr 02 '22 08:04 baveku

@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.

AlexanderEggers avatar Apr 02 '22 08:04 AlexanderEggers

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

myckhel avatar Apr 06 '22 22:04 myckhel

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 ;)

baveku avatar Apr 10 '22 16:04 baveku

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.

myckhel avatar Apr 11 '22 11:04 myckhel

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

StephenTANM avatar Apr 17 '22 05:04 StephenTANM

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.

cortinico avatar May 10 '22 13:05 cortinico

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

kesha-antonov avatar May 10 '22 13:05 kesha-antonov

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.

kesha-antonov avatar May 10 '22 14:05 kesha-antonov

Can anyone post diffs of their project files?

ex3ndr avatar May 17 '22 01:05 ex3ndr

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",

Abhishek2250 avatar May 23 '22 06:05 Abhishek2250

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

baveku avatar May 23 '22 06:05 baveku

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

hamxahussain avatar Jun 19 '22 16:06 hamxahussain

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 [email protected].

hamxahussain avatar Jun 21 '22 07:06 hamxahussain

npx react-native-clean-project worked for me as well with react [email protected] in both android and ios

Ananthakr avatar Jul 03 '22 14:07 Ananthakr

Hi, I'm still facing that error with 0.68.x and 0.69.x, any idea?

Screenshot 2022-08-07 at 15 23 23

My config is:

"react-native-reanimated": "2.9.1",
"react-native-screens": "3.15.0",
"react-native": "0.68.2",
"react-native-safe-area-context": "4.1.4",

have you managed to solve it @baveku ?

skantus avatar Aug 07 '22 13:08 skantus

Hi, I'm still facing that error with 0.68.x and 0.69.x, any idea?

Screenshot 2022-08-07 at 15 23 23

My config is:

"react-native-reanimated": "2.9.1",
"react-native-screens": "3.15.0",
"react-native": "0.68.2",
"react-native-safe-area-context": "4.1.4",

have you managed to solve it @baveku ?

you are using Fabric, right? Reanimated 2 doesn't support Fabric, you can use Reanimated 3(Beta) to work with Fabric. I am still waiting for the Swmansion release Reanimated3, Read this blog: Announcing Reanimated 3

baveku avatar Aug 07 '22 13:08 baveku

you are using Fabric, right? Reanimated 2 doesn't support Fabric, you can use Reanimated 3(Beta) to work with Fabric. I am still waiting for the Swmansion release Reanimated3, Read this blog: Announcing Reanimated 3

Yes, I've enabled Fabric, I'm trying to enable the new Architecture by using RN 0.68 and 0.69, but seems RNReanimated still can't support it as you've mentioned and it's mentioned here as well https://blog.swmansion.com/announcing-reanimated-3-16167428c5f7.

Also the "Software Mansion" has mentioned it here https://twitter.com/swmansion/status/1524382441095446528?s=20&t=umd4xaf4mxBR_dO9XS-8lA but seems they still continue working on it.

cc: @piaskowyk @kmagiera

Thanks, for the early response, I appreciated it @baveku.

skantus avatar Aug 07 '22 19:08 skantus

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:

  • https://github.com/software-mansion/react-native-reanimated/issues/2991#issuecomment-1197886823

tomekzaw avatar Aug 08 '22 07:08 tomekzaw

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:

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

baveku avatar Aug 08 '22 07:08 baveku

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:

  • https://github.com/software-mansion/react-native-reanimated/issues/3439#issuecomment-1205382650

TL;DR We will release 3.0.0 (stable) once we add Layout Animations for Fabric.

tomekzaw avatar Aug 08 '22 07:08 tomekzaw

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

Thanks! This worked for me as well. Upgrade tool with mono-repo react-native app with multiple Xcode schemes didn't work correctly for me so I had to create fresh project.

manish2612 avatar Aug 16 '22 12:08 manish2612

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!

gus-t27 avatar Oct 19 '22 10:10 gus-t27

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

didn't work for React Native version 0.70.5 coming in Expo version 47. @tomekzaw, I can see the latest rc is 3.0.0-rc.10. Might I ask what's your timelines to look into this?

danieldanielecki avatar Jan 24 '23 09:01 danieldanielecki

Changing all AppDelegate.m into AppDelegate.mm inside project.pbxproj (a file with temptation not to look into) worked for me.

danieldanielecki avatar Jan 30 '23 15:01 danieldanielecki

Still running into this issue, even with React Native @ 0.71.3, Reanimated @ 2.8.0, and an updated toolchain. Removing ios/build/, ios/Pods/ and cleaning the project didn't resolve it, and my AppDelegate inside project.pbxproj already has a .mm file extension. What am I missing?

atticusliu avatar Feb 22 '23 02:02 atticusliu

Hey @atticusliu, do you use the new architecture of React Native?

tomekzaw avatar Feb 22 '23 06:02 tomekzaw