react-native: Regression -- 0.72 fails to compile on iOS with use_frameworks! :linkage => :static when using pnpm
New Version
0.72.1
Old Version
0.71.11
Build Target(s)
iOS development
Output of react-native info
info Fetching system and libraries information...
System:
OS: macOS 13.4
CPU: (10) arm64 Apple M1 Pro
Memory: 63.72 MB / 16.00 GB
Shell:
version: 0.80.0
path: /Users/imagio/.cargo/bin/nu
Binaries:
Node:
version: 18.16.0
path: ~/Library/Caches/fnm_multishells/62216_1687887822404/bin/node
Yarn:
version: 1.22.19
path: ~/Library/pnpm/yarn
npm:
version: 9.7.2
path: ~/Library/pnpm/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.11.3
path: /Users/imagio/.asdf/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: Flamingo 2022.2.1 Patch 2 Flamingo 2022.2.1 Patch 2
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.4.1
path: /usr/bin/javac
Ruby:
version: 3.1.2
path: /Users/imagio/.asdf/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.1
wanted: 0.72.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Issue and Reproduction Steps
Reproduction: https://github.com/evelant/rn072-pnpm-monorepo-ios-frameworks-static-bug
React-native 0.72 fails to compile for iOS when using use_frameworks! :linkage => :static
The following build commands failed:
CompileC /Users/imagio/Library/Developer/Xcode/DerivedData/testproj-aijjqxpffhriwvdbnbtslrapnlmx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-utils.build/Objects-normal/arm64/RunLoopObserver.o /Users/imagio/dev/test/node_modules/.pnpm/react-native@0.72.1_@babel+core@7.20.2_@babel+preset-env@7.20.2_react@18.2.0/node_modules/react-native/ReactCommon/react/utils/RunLoopObserver.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-utils' from project 'Pods')
(1 failure)
To reproduce:
pnpm install
cd apps/testproj/ios
USE_FRAMEWORKS=static pod install
cd ..
pnpm react-native run-ios
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 28 (4 by maintainers)
Commits related to this issue
- Fix build failure on iOS with pnpm and use_frameworks! (#38158) Summary: Fix build failure on iOS with pnpm and use_frameworks! due to cocoapods copying symlinked headers to wrong paths When using p... — committed to facebook/react-native by deleted user 3 years ago
- Fix build failure on iOS with pnpm and use_frameworks! (#38158) Summary: Fix build failure on iOS with pnpm and use_frameworks! due to cocoapods copying symlinked headers to wrong paths When using p... — committed to expo/react-native by deleted user 3 years ago
@goguda i am getting this error, i am using npm node_modules/react-native/ReactCommon/react/utils/RunLoopObserver.cpp:10:10: ‘react/debug/react_native_assert.h’ file not found
this is my podfile
and package.json file
Started getting this error after firebase messaging setup
can you try running
USE_FRAMEWORKS=static NO_FLIPPER=1 pod install? Flipper is not compatible withuse_frameworks(and it will never be).Thanks @DaniloMladenovic 🙏🏻 I added this to my expo plugins and it worked like a charm ✨
Adding:
pod 'GoogleUtilities', :modular_headers => true # Add missing packagepod 'FirebaseCore', :modular_headers => true # Add missing packagepod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app' # Firebase manual setupinstead of
use_frameworks! :linkage => :statichelped me.@evelant how to apply above patch ? when tried with patch-package it says invalid patch file
I facing this issue, the error occurs when using
use_frameworks! :linkage => :staticin combination withpnpm. I tried two solutions :Solution 1: Switch to
npmoryarnThe easiest solution is to switch tonpmoryarninstead ofpnpm. However, this approach should be avoided in monorepos where it’s important to use the same package manager across the entire repository. => not my choiceSolution 2: Avoid
use_frameworks! :linkage => :staticand Set Up Manually Instead of usinguse_frameworks! :linkage => :static, I manually configure the setup. For example, to set up Firebase, follow the official documentation here: Firebase iOS Installation Guide.I also noticed a pull request addressing this issue—hopefully, it will be merged soon, and we won’t need to apply this manual fix anymore.
Here is my environment for reference:
I use monorepo with pnpm: ./
My Podfile:
For me, I was placing this line of code:
rn_maps_path = '../node_modules/react-native-maps'pod 'react-native-google-maps', :path => rn_maps_pathabove
target 'commutebuddy' doconfig = use_native_modules!It was supposed to be inside.
I get the error: ‘react/debug/react_native_assert.h’ file not found, React-utils/RunLoopObserver. This is my Podfile: