react-native: React-bridging wrong paths?
Description
Wrong React-bridging directories structure:
xxx/ios/Pods/Headers/Public/React-bridging/react/bridging/react/bridging/LongLivedObject.h
should be:
xxx/ios/Pods/Headers/Public/React-bridging/react/bridging/LongLivedObject.h
So xxx/node_modules/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h
has wrong imports like
#include <react/bridging/CallbackWrapper.h>
#include <react/bridging/LongLivedObject.h>
Version
0.69.1
Output of npx react-native info
warn Package react-native-appsflyer has been ignored because it contains invalid configuration. Reason: “dependency.platforms.ios.podspecPath” is not allowed warn Package @svgr/webpack has been ignored because it contains invalid configuration. Reason: Package subpath ‘./package.json’ is not defined by “exports” in /Users/webx/_WEBX/gigaverse-mobile/node_modules/@svgr/webpack/package.json info Fetching system and libraries information… System: OS: macOS 12.4 CPU: (8) arm64 Apple M1 Memory: 102.55 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node Yarn: 1.22.19 - ~/.yarn/bin/yarn npm: 8.5.5 - ~/.nvm/versions/node/v16.13.1/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Android NDK: 22.1.7171670 IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /opt/homebrew/opt/openjdk@11/bin/javac npmPackages: @react-native-community/cli: Not Found react: ^18.2.0 => 18.2.0 react-native: ^0.69.1 => 0.69.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
0.69.1 react native and for example install react-native-vision-camera
Snack, code example, screenshot, or link to a repository
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 12
- Comments: 59 (6 by maintainers)
Commits related to this issue
- Try upgrade RN to 0.69.1 Not working for now because of: - Android: expo incompatibility https://github.com/expo/expo/issues/18166 - iOS: https://github.com/facebook/react-native/issues/34102 — committed to LedgerHQ/ledger-live by ofreyssinet-ledger 2 years ago
- Apply patch to React-bridging https://github.com/facebook/react-native/issues/34102 — committed to shirakaba/rnobjc by shirakaba 2 years ago
this may fix the header not found error:
if that works fine, maybe we could propose the fix to the
react_native_post_install
helper.for
jsi::
->facebook::jsi::
namespace change, it is from 009d80bf5a55dd74be448960b1344ac7599c6bae and it’s a better practice IMO even though that requires third party modules to fix the breaking code.It seems React Native 0.72.0 brought back this issue. I’m getting
'react/bridging/CallbackWrapper.h' file not found
on 0.72.0. Build succeeds on 0.71.11. I tried a few of the workarounds here and in 1121, but no luck so far. I’ll keep trying different approaches and hold the upgrade for now.Changing header_dir to dot helps:
Hi all, I’m a bit late to the party here and can’t remember all my steps, but I was running into this using React Native firebase with use_frameworks! :linkage => :static and an Nx monorepo, I think it may be a combo of those two things that caused my issues. I’m using “react-native”: “0.70.1” which seems to have @Kudo’s patch already in it to update the Header paths. After digging around on where the headers ended up I emulated what he had done in my Pod file and added the PODS_TARGET_SRCROOT to it and my app was able to build properly. YMMV.
(Note I’m a Typescipt/JS guy not an iOS developer so I’m just slightly informed on what I’m actually doing here)
Checkout this pull: https://github.com/mrousavy/react-native-vision-camera/pull/1109. Need to wait new release of vision camera… or you can use patch (it also fix android build errors): react-native-vision-camera+2.13.5.patch.txt
I’m still having this issue on 0.72.3 while trying to use react-native-vision-camera 2.15.4. None of the patches mentioned have worked.
"react-native": "0.71.0-rc.3"
same issuehey folks - RN 0.69.3 is out and contains the fix from @Kudo; let us know if this issue is fixed now for you!
So, honestly I didn’t find any explicit solutions proposed besides commits / patches that were already merged into the
main
branch and theoretically are already applied to thereact-native
version I’m using. I don’t really understand if the issue I’m facing is on thereact-native-vision-camera
lib code or if it’s a problem withreact-native
itself, but the issue persists to me 😞@kelset i am thinking to propose the workaround to react_native_pods.rb. that will fix the build errors from some third party modules like vision-camera.
Facing the same issue after upgrading to 0.69.1
same on
"react-native": "^0.72.8"
i have to useuse_modular_headers!
anduse_frameworks!
Same issue here, using
react-native
@0.72.4
,react-native-vision-camera
@^2.15.6
and@react-native-firebase/app
@^18.3.1
. Have to useuse_frameworks! :linkage => :static
in my Podfile as the firebase instructions say, but then I get the'react/bridging/CallbackWrapper.h' file not found
error. Have tried pretty much all possible workarounds posted on many issues and the error persists. Downgrading thereact-native
version is not an option for us, neither do I think it’s a good a idea to downgrade the@react-native-firebase/app
version so thatuse_frameworks
is no longer required. Does anyone have any clue on this?@shirakaba #34214 was targeting for third party modules but not the app target. for app targets, please add the React-bridging search path to the project.pbxproj
Same exact issue here
Have to use these, in the app.json
started happening once switched to useFrameworks: static I need firebase module as well as react-native-vision-camera and react-native-quick-crypto Happening with “react-native”: “0.72.6”
Also experiencing the issue (using use_frameworks! :linkage => :static for firebase), with “react-native”: “0.72.7”, “react-native-vision-camera”: “^3.6.12”,
@fontesrp these I did not, didn’t come across this issue to be honest. Thanks for the suggestion, I’ll spend some time reading and trying the proposed solutions there. I’ll let you know how it goes 👍
Seems to be fixed in
0.71.0-rc.5
, but unfortunately this version is still not supported by expo, so my problem remains https://github.com/invertase/react-native-firebase/issues/6800Hmm I’m running into this one trying to transition to
use_frameworks!
for react-native-firebase v15+ support. In my case there seems to be an issue with paths when usingpnpm
that’s preventing the headers from getting copied into theios/Pods/Headers/Private/React-bridging/react/bridging
folder like they should. Instead they get copied toios/build/Build/node_modules/.pnpm/react-native@0.69.5_unoo4p5zfjb5v6bnauqzc4ataq_lx6v52nf6lj3r6bs5j5fbvoknq/node_modules/react-native/ReactCommon/react/bridging
which is clearly not the correct location. This is on 0.69.5 expo 46.0.10 with dev-client .@Kudo any idea where/when the paths get calculated for the copy step for header files on iOS? I have little familiarity with cocoapods so I haven’t been able to find it.
@Kudo @kelset still an issue in a project based on 0.69.3, I’m afraid. Here’s an MWE. It’s just the 0.69.3 starter template, with the files
JSIUtils.h
andJSIUtils.mm
(from react-native-vision-camera) added to the iOS build target.https://github.com/shirakaba/repro-react-bridging-header-not-found
It fails upon trying to build the file
JSIUtils.mm
, due to its include of<ReactCommon/TurboModuleUtils.h>
.My environment:
since this is fixed in 0.69.1, does it mean we can close this off?
thanks for the awesome example repo @Polyrion. my fix is to address the use_frameworks error on 0.69.0 and landed on 0.69.1. it makes sense for 0.69.1 well work. please let me know if you still encounter other errors on 0.69.1.
Also don’t forget to do a pod install afterwards
Sure. Create a file in your root directory called
patches/react-native+0.69.1.patch
with contentsHi I got this error too on react 0.69.0 and 0.69.1, the fact that I’m creating a bridge and turn on !use_framework to make a wrapper for MapBox Navigation SDK trow me that CallBackWrapper is not found and I tried any solution proposed and still got this error.
Did someone found how to fix this ?