Repository navigation
Closed
Labels
Impact: RegressionDescribes a behavior that used to work on a prior release, but stopped working recently.Describes a behavior that used to work on a prior release, but stopped working recently.Needs: Triage 🔍Platform: iOSiOS applications.iOS applications.Type: Upgrade IssueIssues reported from upgrade issue formIssues reported from upgrade issue form
Description
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
Reacted by David Goguen, Robert, David Kantor, Gohel Meet and Jose Ortiz
Metadata
Metadata
Assignees
Labels
Impact: RegressionDescribes a behavior that used to work on a prior release, but stopped working recently.Describes a behavior that used to work on a prior release, but stopped working recently.Needs: Triage 🔍Platform: iOSiOS applications.iOS applications.Type: Upgrade IssueIssues reported from upgrade issue formIssues reported from upgrade issue form
Activity
cipolleschi commentedon Jun 30, 2023
We have tests in CI that checks that the static frameworks builds (e.g.: Old Arch, Static Frameworks and Old Arch, dynamic frameworks)
and they work on the new arch as well (e.g.: Hermes, JSC)
These create a new app from the templates and install the pods accordingly, so that shouldn't happen.
Could it be a problem of
pnpm? That's a setup we are actually not testing.Also, this error:
Doesn't really told us anything: it only says that it failed to build
RunLoopObserver.cppbut not why... :/Could you provide the whole build log, uploading it somewhere?
evelant commentedon Jun 30, 2023
@cipolleschi apologies! I copy pasted the wrong snippet 🤦
The failure in
RunLoopObserver.cppis'react/debug/react_native_assert.h' file not found.Here's a full build log: https://gist.github.com/evelant/2e1479de86cde27e287f07974c9b8d53
evelant commentedon Jun 30, 2023
IIRC there was an issue with header paths that was pnpm specific in previous versions but it got fixed. Here it is: #34102
evelant commentedon Jun 30, 2023
Here's the reproduction without using pnpm, same failure
https://github.com/evelant/rn072-ios-frameworks-static-failure
cipolleschi commentedon Jun 30, 2023
can you try running
USE_FRAMEWORKS=static NO_FLIPPER=1 pod install?Flipper is not compatible with
use_frameworks(and it will never be).[-]Regression -- 0.72 fails to compile on iOS with use_frameworks! :linkage => :static [/-][+]Regression -- 0.72 fails to compile on iOS with use_frameworks! :linkage => :static when using pnpm[/+]evelant commentedon Jun 30, 2023
This is a pnpm issue -- failure is the same with NO_FLIPPER=1 on the pnpm reproduction. Most likely a resurfacing of #34102 due to how headers at symlinked paths in the pnpm store get copied
evelant commentedon Jun 30, 2023
This is indeed the same issue as before. I don't remember how it got resolved unfortunately. The problem is that the headers get copied into the wrong directory:
evelant commentedon Jun 30, 2023
Related commits and issues:
8131b7b
#25349
evelant commentedon Jun 30, 2023
@cipolleschi I found and fixed the issue, although I'm not sure if my solution is ideal.
The problem is that cocoapods doesn't resolve the symlink when
header_mappings_diris set in the podspec. That causes headers to get copied as a relative path to the inside of the pnpm store instead of to their actual output directory. You end up with headers inBuild/node_modules/.pnpm/react-native/node_modules/react-native/ReactCommon/react/...etcinstead of in the framework dirs.To fix this I altered the podspecs to resolve the absolute paths for
header_mappings_dir. I also fixed a number of search paths that didn't work correctly (I think they may have always been incorrect but worked by luck with yarn).Here's a patch
react-native@0.72.1.patch
Janak-Nirmal commentedon Jul 1, 2023
@evelant how to apply above patch ? when tried with patch-package it says invalid patch file
7 remaining items
goguda commentedon Jul 7, 2023
Nope no patch needed, worked as expected once I changed my Podfile and added iOS permissions to
reactNativePermissionsIOSin my package.json as per the documentation.enchorb commentedon Jul 7, 2023
Applying the patch 58adc5e fixed it for me (using yarn)
Fix build failure on iOS with pnpm and use_frameworks! (#38158)
maksibajo4 commentedon Jul 11, 2023
I get the error: 'react/debug/react_native_assert.h' file not found, React-utils/RunLoopObserver.
This is my Podfile:
Fix build failure on iOS with pnpm and use_frameworks! (react#38158)
billnbell commentedon Jul 12, 2023
I have a PR for adding 2 more to the search path can you take a look? @evelant
#38247
goguda commentedon Jul 20, 2023
You're using react-native-permissions the old way like I was. Try the fix I posted above^
harouf commentedon Jul 20, 2023
@maksibajo4 Did you fix the build issue you faced? I am also facing the same issue as I also have some dynamic frameworks (iProov) to be exempted from being converted to static library.
harouf commentedon Jul 20, 2023
@goguda the issue is basically due to this part and updating the integration of RN permissions doesn't help.
Vrunalbenke commentedon Mar 18, 2024
@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
{ "name": "vendit", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest", "android-clean": "cd android && gradlew clean && gradlew :app:bundleRelease", "build-apk": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/ && rm -rf android/app/src/main/res/drawable-* && rm -rf android/app/src/main/res/raw/* && cd android && ./gradlew assembleRelease && cd ..", "build-debug-apk": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/debug/ && rm -rf android/app/src/main/res/drawable-* && rm -rf android/app/src/main/res/raw/* && cd android && gradlew assembleDebug && cd ..", "iLegacy": "npm i --legacy-peer-deps" }, "dependencies": { "@gorhom/bottom-sheet": "^4.5.1", "@notifee/react-native": "^7.8.2", "@react-native-async-storage/async-storage": "^1.19.3", "@react-native-community/blur": "^4.3.2", "@react-native-community/cli-platform-android": "^11.3.8", "@react-native-community/datetimepicker": "^7.6.0", "@react-native-community/netinfo": "^9.4.1", "@react-native-firebase/app": "^18.9.0", "@react-native-firebase/dynamic-links": "^18.9.0", "@react-native-firebase/messaging": "^18.9.0", "@react-native-masked-view/masked-view": "^0.2.9", "@react-navigation/bottom-tabs": "^6.5.9", "@react-navigation/elements": "^1.3.19", "@react-navigation/material-top-tabs": "^6.6.12", "@react-navigation/native": "^6.1.8", "@react-navigation/native-stack": "^6.9.14", "@reduxjs/toolkit": "^1.9.6", "axios": "^1.5.1", "base64-js": "^1.5.1", "deprecated-react-native-prop-types": "^5.0.0", "i18next": "^23.5.1", "lottie-ios": "^4.4.0", "lottie-react-native": "^6.6.0", "patch-package": "^8.0.0", "react": "18.2.0", "react-i18next": "^13.2.2", "react-native": "0.72.5", "react-native-asset": "^2.1.1", "react-native-camera": "^4.2.1", "react-native-country-picker-modal": "^2.0.0", "react-native-geolocation-service": "^5.3.1", "react-native-gesture-handler": "^2.13.1", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-linear-gradient": "^2.8.3", "react-native-maps": "^1.7.1", "react-native-modal": "^13.0.1", "react-native-modal-popover": "^2.1.3", "react-native-navigation-bar-color": "^2.0.2", "react-native-pager-view": "^6.2.1", "react-native-permissions": "^3.10.1", "react-native-popup-menu": "^0.16.1", "react-native-qrcode-scanner": "^1.5.5", "react-native-qrcode-svg": "^6.3.0", "react-native-reanimated": "^3.7.2", "react-native-safe-area-context": "^4.7.2", "react-native-screens": "^3.25.0", "react-native-share": "^10.0.2", "react-native-shimmer-placeholder": "^2.0.9", "react-native-splash-screen": "^3.3.0", "react-native-svg": "^13.14.0", "react-native-svg-transformer": "^1.1.0", "react-native-tab-view": "^3.5.2", "react-native-toast-message": "^2.1.6", "react-native-vector-icons": "^10.0.1", "react-native-webview": "^13.7.0", "react-native-wheel-pick": "^1.2.2", "react-redux": "^8.1.2", "redux": "^4.2.1", "rn-fetch-blob": "^0.12.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/eslint-config": "^0.72.2", "@react-native/metro-config": "^0.72.11", "babel-jest": "^29.2.1", "babel-plugin-module-resolver": "^5.0.0", "eslint": "^8.19.0", "jest": "^29.2.1", "metro-react-native-babel-preset": "0.76.8", "prettier": "^2.4.1", "react-test-renderer": "18.2.0" }, "engines": { "node": ">=16" }, "resolutions": { "react-native-permissions": "^3.8.0" }, "overrides": { "react-native-qrcode-scanner": { "react-native-permissions": "^3.8.0" } } }Started getting this error after firebase messaging setup
Djotchuang commentedon Oct 18, 2024
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.
hoangf-mmj commentedon Dec 20, 2024
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 to
npmoryarninstead 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 ManuallyInstead of using
use_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:
DaniloMladenovic commentedon Jan 15, 2025
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.pakerwreah commentedon Jan 21, 2025
Thanks @DaniloMladenovic 🙏🏻
I added this to my expo plugins and it worked like a charm ✨
Fix build failure on iOS with pnpm and use_frameworks! (#38158)