React-bridging wrong paths?

See original GitHub issue

Description

CleanShot 2022-06-29 at 18 44 51 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

CleanShot 2022-06-29 at 18 51 42 CleanShot 2022-06-29 at 18 52 03 CleanShot 2022-06-29 at 18 52 13

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:11
  • Comments:44 (6 by maintainers)

github_iconTop GitHub Comments

14reactions
Kudocommented, Jul 11, 2022

this may fix the header not found error:

--- a/ios/Podfile
+++ b/ios/Podfile
@@ -33,5 +33,14 @@ target 'RN069' do
   post_install do |installer|
     react_native_post_install(installer)
     __apply_Xcode_12_5_M1_post_install_workaround(installer)
+
+   installer.pods_project.targets.each do |target|
+     target.build_configurations.each do |config|
+       config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
+       config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" '
+       config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" '
+     end
+   end
+
   end
 end

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.

9reactions
s5z6commented, Jul 6, 2022

Changing header_dir to dot helps:

diff --git a/node_modules/react-native/ReactCommon/React-bridging.podspec b/node_modules/react-native/ReactCommon/React-bridging.podspec
index 5255c13..52a8eb0 100644
--- a/node_modules/react-native/ReactCommon/React-bridging.podspec
+++ b/node_modules/react-native/ReactCommon/React-bridging.podspec
@@ -30,7 +30,7 @@ Pod::Spec.new do |s|
   s.source                 = source
   s.source_files           = "react/bridging/**/*.{cpp,h}"
   s.exclude_files          = "react/bridging/tests"
-  s.header_dir             = "react/bridging"
+  s.header_dir             = "."
   s.header_mappings_dir    = "."
   s.compiler_flags         = folly_compiler_flags
   s.pod_target_xcconfig    = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\"",

After doing this I’ve not got a new error:

Use of undeclared identifier 'jsi'; did you mean 'facebook::jsi'?

Screenshot 2022-07-06 at 16 02 00

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode wrong Path to Module - react native - Stack Overflow
The main-Issue seems to be an react-native && xcode Bug. Xcode seems to start the packager from another directory, which's the cause of...
Read more >
Need help to resolve error "using bridging headers with ...
1) Created Bridging header file and added into project target. 2)Added import statement to header file "#import <sqlite3.h>". 3) This header is marked...
Read more >
react-native-awesome-camera - NPM Package Overview
A React Native package that allows you to select a photo/video from the device library or camera. Version: 1.0.8 was published by krinish291 ......
Read more >
How to Bridge an Objective-C View Component - Code Daily
I am not an Objective-C developer so some of the things I say here may be wrong, so tell me if I'm wrong!...
Read more >
Installation - WatermelonDB documentation
You might have to tweak the import path to correctly locate Watermelon's bridging header. Android (React Native). Set up Babel config in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found