react-native: 'react/bridging/LongLivedObject.h' file not found And Could not build module 'ReactCommon'
Description
<Project path>/Pods/Headers/Public/ReactCommon/ReactCommon/LongLivedObject.h:11:10 ‘react/bridging/LongLivedObject.h’ file not found
<Project path>/Pods/Headers/Public/React-Core/React/RCTAppSetupUtils.h:30:9 Could not build module ‘ReactCommon’

Version
0.70.6
Output of npx react-native info
System: OS: macOS 13.0.1 CPU: (8) x64 Apple M1 Pro Memory: 11.91 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.2.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.19.3 - /usr/local/bin/npm Watchman: 2022.11.28.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: ^0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Integrated RN version 0.70.6 to existing ios apps Installed pod vial this command RCT_NEW_ARCH_ENABLED=1 fabric_enabled=1 arch -x86_64 pod install
Snack, code example, screenshot, or link to a repository

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 22 (9 by maintainers)
Commits related to this issue
- Remove redundant LongLivedObject import in RCTTurboModule.mm (#41368) Summary: Similarly to https://github.com/facebook/react-native/issues/36391 , we found that this import was periodically causing ... — committed to facebook/react-native by hieu9102002 8 months ago
- Remove redundant LongLivedObject import in RCTTurboModule.mm (#41368) Summary: Similarly to https://github.com/facebook/react-native/issues/36391 , we found that this import was periodically causing ... — committed to Othinn/react-native by hieu9102002 8 months ago
Hi there, I’m sorry for this problem.
Can anyone provide a repro I can try on my own?
It’s not the first time we see such issues. Our CI has tests for both the Old and the New Architecture, to make sure that it builds, so it should be some edge case that we are not handling properly.
For context:
LongLivedObject.h
: one inReactCommon/react/bridging
and one in ReactCommon/react/nativemodule/core/ReactCommon.use_frameworks!
actually work as expected.Now, my gut feeling is that there is something in your configuration that changes the HEADER_SEARCH_PATH of React Native and makes it lose the reference to the
ReactCommon
base path.But to verify this, I’ll need to reproduce it on a small sample.
Here is the patch-package for react-native 0.71.3 :
create patches/react-native+0.71.3.patch and add
"postinstall": "patch-package"
in your package.json.Are you using Expo? Or just some libraries from Expo but the main flow is handled by the RN CLI?