facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.27k stars 24.35k forks source link

React-bridging wrong paths? #34102

Closed mm-webx closed 2 years ago

mm-webx commented 2 years ago

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

rahulYaper commented 2 years ago

Facing the same issue after upgrading to 0.69.1

Screen Shot 2022-06-30 at 4 56 43 PM
tomlameche commented 2 years ago

Same issue. Does anyone have a tip to pass out ?

marquina-abreu commented 2 years ago

Same issue

karatekid430 commented 2 years ago

Same

raufpratama commented 2 years ago

same issue

mm-webx commented 2 years ago

Its possible to copy files to correct path, but its not long term solution

mm-webx commented 2 years ago

I think can be related to this: https://github.com/facebook/react-native/commit/f97c6a5b498eec95e99a02c7842cb2ae160cd6cd

CleanShot 2022-07-01 at 12 04 06

CleanShot 2022-07-01 at 12 04 28

so adding

# The prefix to react-native
prefix = "../node_modules/react-native"
pod 'React-bridging', :path => "#{prefix}/ReactCommon/react/bridging"

on the end of pod file should fix an issue, I will try it soon and back with details.

s5z6 commented 2 years ago

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\"",
OlleThunbergDevoteam commented 2 years ago

Same issue here

rocket13011 commented 2 years ago

same issue here too.

kierancrown commented 2 years ago

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

s5z6 commented 2 years ago

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

devinkg commented 2 years ago

I'm also having same issue here.

System: OS: macOS 12.4 CPU: (8) arm64 Apple M1 Memory: 92.28 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.15.0 - /usr/local/bin/node Yarn: Not Found npm: 8.6.0 - /opt/homebrew/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.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8512546 Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.1 => 0.69.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

VanDinh18 commented 2 years ago

i added patch but not work System: OS: macOS 12.3.1 CPU: (8) x64 Apple M1 Memory: 34.13 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node Yarn: 1.22.19 - ~/Documents/Adamo/keiyo-club-app/node_modules/.bin/yarn npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm Watchman: 2022.05.16.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 29, 30, 31, 32 Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0 System Images: android-30 | Intel x86 Atom_64, android-31 | Google Play ARM 64 v8a, android-32 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild Languages: Java: 11.0.11 - /usr/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

Kudo commented 2 years ago

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.

nica0012 commented 2 years ago

How do you add patch? I am having this error in xcode. Been waiting for new release but I think I will try this to get things going.

kierancrown commented 2 years ago

Create a patches directory in the root of your project and add your patches making sure they end in the .patch extension. Then install patch-package and follow the setup guide.

Polyrion commented 2 years ago

Hi 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 ?

kierancrown commented 2 years ago

Hi 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 ?

Apply the mentioned patches above. Fixed for me in 0.69.1

Polyrion commented 2 years ago

@kierancrown you're talking about Kudo proposition with Podfile ? cause I tried too and didn't work or can you just tell me which one work for you.

kierancrown commented 2 years ago

@kierancrown you're talking about Kudo proposition with Podfile ? cause I tried too and didn't work or can you just tell me which one work for you.

Sure. Create a file in your root directory called patches/react-native+0.69.1.patch with contents

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\"",
Polyrion commented 2 years ago

@kierancrown :/ still got the issue Capture d’écran 2022-07-15 à 16 25 35

there is my patch file that got applied successfully :

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\"",

Podfile :

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

use_frameworks!
target 'mapnav' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"

  # Pods for Mapbox navigation
  pod 'MapboxNavigation', '~> 2.6'

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'mapnavTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  if !ENV['CI']
    # local configuration
    # use_flipper!()
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
        end
      end
      react_native_post_install(installer)
      __apply_Xcode_12_5_M1_post_install_workaround(installer) if defined?(__apply_Xcode_12_5_M1_post_install_workaround)
    end
  else
    # CI configuration
    post_install do |installer|
      react_native_post_install(installer)
      __apply_Xcode_12_5_M1_post_install_workaround(installer) if defined?(__apply_Xcode_12_5_M1_post_install_workaround)
    end
  end
end

Pod install was successful

Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.69.1)
Installing FBReactNativeSpec (0.69.1)
Installing MapboxCommon (22.0.0)
Installing MapboxCoreMaps (10.6.1)
Installing MapboxCoreNavigation (2.6.0)
Installing MapboxDirections (2.6.0)
Installing MapboxMaps (10.6.1)
Installing MapboxMobileEvents (1.0.8)
Installing MapboxNavigation (2.6.0)
Installing MapboxNavigationNative (106.0.0)
Installing MapboxSpeech (2.0.1)
Installing Permission-Camera (3.5.0)
Installing Permission-LocationAccuracy (3.5.0)
Installing Permission-LocationAlways (3.5.0)
Installing Permission-LocationWhenInUse (3.5.0)
Installing Polyline (5.0.2)
Installing RCT-Folly (2021.06.28.00-v2)
Installing RCTRequired (0.69.1)
Installing RCTTypeSafety (0.69.1)
Installing RNBootSplash (4.2.3)
Installing RNFastImage (8.5.11)
Installing RNGestureHandler (2.5.0)
Installing RNPermissions (3.5.0)
Installing RNReanimated (2.9.1)
Installing RNSVG (12.3.0)
Installing RNScreens (3.15.0)
Installing React (0.69.1)
Installing React-Codegen (0.69.1)
Installing React-Core (0.69.1)
Installing React-CoreModules (0.69.1)
Installing React-RCTActionSheet (0.69.1)
Installing React-RCTAnimation (0.69.1)
Installing React-RCTBlob (0.69.1)
Installing React-RCTImage (0.69.1)
Installing React-RCTLinking (0.69.1)
Installing React-RCTNetwork (0.69.1)
Installing React-RCTSettings (0.69.1)
Installing React-RCTText (0.69.1)
Installing React-RCTVibration (0.69.1)
Installing React-bridging (0.69.1)
Installing React-callinvoker (0.69.1)
Installing React-cxxreact (0.69.1)
Installing React-jsi (0.69.1)
Installing React-jsiexecutor (0.69.1)
Installing React-jsinspector (0.69.1)
Installing React-logger (0.69.1)
Installing React-perflogger (0.69.1)
Installing React-runtimeexecutor (0.69.1)
Installing ReactCommon (0.69.1)
Installing SDWebImage (5.11.1)
Installing SDWebImageWebPCoder (0.8.5)
Installing Solar-dev (3.0.1)
Installing Turf (2.4.0)
Installing Yoga (1.14.0)
Installing boost (1.76.0)
Installing fmt (6.2.1)
Installing glog (0.3.5)
Installing libwebp (1.2.1)
Installing react-native-geolocation (2.1.0)
Installing react-native-safe-area-context (4.3.1)
Installing react-native-spinkit (1.4.1)

but still can't understand why I still got the issue am I missing something ?

s5z6 commented 2 years ago

@Polyrion it's not same issue. Try to remove use_frameworks and add :modular_headers => true only for mapbox pod

Polyrion commented 2 years ago

:modular_headers => true

Hi @s5z6 so I removed use_framework and added modular_headers => true it resolved the issue about bridging not found but cause me another one that called Multiple commands produce

  # Pods for Mapbox navigation
  pod 'MapboxNavigation', '~> 2.6', :modular_headers => true

Capture d’écran 2022-07-15 à 16 45 31

Does that talk to you ?

thank you

kierancrown commented 2 years ago

@kierancrown :/ still got the issue Capture d’écran 2022-07-15 à 16 25 35

there is my patch file that got applied successfully :

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\"",

Podfile :

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

use_frameworks!
target 'mapnav' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"

  # Pods for Mapbox navigation
  pod 'MapboxNavigation', '~> 2.6'

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'mapnavTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  if !ENV['CI']
    # local configuration
    # use_flipper!()
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
        end
      end
      react_native_post_install(installer)
      __apply_Xcode_12_5_M1_post_install_workaround(installer) if defined?(__apply_Xcode_12_5_M1_post_install_workaround)
    end
  else
    # CI configuration
    post_install do |installer|
      react_native_post_install(installer)
      __apply_Xcode_12_5_M1_post_install_workaround(installer) if defined?(__apply_Xcode_12_5_M1_post_install_workaround)
    end
  end
end

Pod install was successful

Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.69.1)
Installing FBReactNativeSpec (0.69.1)
Installing MapboxCommon (22.0.0)
Installing MapboxCoreMaps (10.6.1)
Installing MapboxCoreNavigation (2.6.0)
Installing MapboxDirections (2.6.0)
Installing MapboxMaps (10.6.1)
Installing MapboxMobileEvents (1.0.8)
Installing MapboxNavigation (2.6.0)
Installing MapboxNavigationNative (106.0.0)
Installing MapboxSpeech (2.0.1)
Installing Permission-Camera (3.5.0)
Installing Permission-LocationAccuracy (3.5.0)
Installing Permission-LocationAlways (3.5.0)
Installing Permission-LocationWhenInUse (3.5.0)
Installing Polyline (5.0.2)
Installing RCT-Folly (2021.06.28.00-v2)
Installing RCTRequired (0.69.1)
Installing RCTTypeSafety (0.69.1)
Installing RNBootSplash (4.2.3)
Installing RNFastImage (8.5.11)
Installing RNGestureHandler (2.5.0)
Installing RNPermissions (3.5.0)
Installing RNReanimated (2.9.1)
Installing RNSVG (12.3.0)
Installing RNScreens (3.15.0)
Installing React (0.69.1)
Installing React-Codegen (0.69.1)
Installing React-Core (0.69.1)
Installing React-CoreModules (0.69.1)
Installing React-RCTActionSheet (0.69.1)
Installing React-RCTAnimation (0.69.1)
Installing React-RCTBlob (0.69.1)
Installing React-RCTImage (0.69.1)
Installing React-RCTLinking (0.69.1)
Installing React-RCTNetwork (0.69.1)
Installing React-RCTSettings (0.69.1)
Installing React-RCTText (0.69.1)
Installing React-RCTVibration (0.69.1)
Installing React-bridging (0.69.1)
Installing React-callinvoker (0.69.1)
Installing React-cxxreact (0.69.1)
Installing React-jsi (0.69.1)
Installing React-jsiexecutor (0.69.1)
Installing React-jsinspector (0.69.1)
Installing React-logger (0.69.1)
Installing React-perflogger (0.69.1)
Installing React-runtimeexecutor (0.69.1)
Installing ReactCommon (0.69.1)
Installing SDWebImage (5.11.1)
Installing SDWebImageWebPCoder (0.8.5)
Installing Solar-dev (3.0.1)
Installing Turf (2.4.0)
Installing Yoga (1.14.0)
Installing boost (1.76.0)
Installing fmt (6.2.1)
Installing glog (0.3.5)
Installing libwebp (1.2.1)
Installing react-native-geolocation (2.1.0)
Installing react-native-safe-area-context (4.3.1)
Installing react-native-spinkit (1.4.1)

but still can't understand why I still got the issue am I missing something ?

Also don't forget to do a pod install afterwards

Kudo commented 2 years ago

@Polyrion my fix is originally to address use_frameworks!, so it doesn't make sense you have to turn off use_frameworks. do you have a minimal reproducible example repository? i can try to take a further look in case it helps.

Polyrion commented 2 years ago

@Kudo i was thinking the same about use_framework, I tried with : RN 68.2 Fresh install work well RN 69 Fresh install broke a Path React Bridging Error :/ RN 69.1 Fresh install work Well

I'm looking on my 69.1 project if the error could not come from a dependency

there are the different public repo : https://github.com/Polyrion/mapnav https://github.com/Polyrion/mapnav_rn69.0 https://github.com/Polyrion/mapnav_rn_69.1

Thanks for your help

Kudo commented 2 years ago

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.

kelset commented 2 years ago

since this is fixed in 0.69.1, does it mean we can close this off?

Kudo commented 2 years ago

@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.

jpike88 commented 2 years ago

@kelset I'm on 0.69.1 and just run into this issue, as far as I know this is not fixed/release on a main branch yet.

Kudo commented 2 years ago

@jpike88 pr #34214 reviewing

kelset commented 2 years ago

hey folks - RN 0.69.3 is out and contains the fix from @Kudo; let us know if this issue is fixed now for you!

mm-webx commented 2 years ago

Thanks everyone, especially @Kudo 🎉

shirakaba commented 2 years ago

@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 and JSIUtils.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>.

image

My environment:

$ npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 12.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 17.97 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.volta/tools/image/node/16.13.1/bin/node
    Yarn: 1.22.18 - ~/.volta/tools/image/yarn/1.22.18/bin/yarn
    npm: 8.1.2 - ~/.volta/tools/image/node/16.13.1/bin/npm
    Watchman: 4.9.0 - /Users/jamie/.nix-profile/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/jamie/.local/share/gem/ruby/3.0.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 32
      Build Tools: 32.1.0, 33.0.0
      System Images: android-32 | Google Play ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8609683
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.1 - /Users/jamie/.nix-profile/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.3 => 0.69.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
Kudo commented 2 years ago

@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

evelant commented 2 years ago

Hmm 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 using pnpm that's preventing the headers from getting copied into the ios/Pods/Headers/Private/React-bridging/react/bridging folder like they should. Instead they get copied to ios/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.

evelant commented 2 years ago

I created a reproduction here https://github.com/evelant/test-pnpm-ios-headers-path-bug

jorgegvallejo commented 2 years ago

I still got this error on RN 0.70.3 and this comment from Kudo helped me.

I'm not using use_frameworks! though

kelset commented 2 years ago

is /React-bridging something Expo specific? 🤔

need a repro for react-native init'd component

evelant commented 2 years ago

@kelset here's a reproduction without expo https://github.com/evelant/rnfbdemo

adiffmike commented 2 years ago

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)

   __apply_Xcode_12_5_M1_post_install_workaround(installer) // after this
    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_TARGET_SRCROOT)" '
      end
    end
meftunca commented 1 year ago

Screenshot 2022-12-02 at 17 14 53

"react-native": "0.71.0-rc.3" same issue

atanaskanchev commented 1 year ago

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/6800

pottercomuneo commented 1 year ago

I'm still facing @shirakaba's exact same issue, in RN 0.69.8 and react-native-vision-camera 2.15, and I already followed all the suggestions with no success. How did you solve?

fontesrp commented 1 year ago

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.

reedling78 commented 1 year ago

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.

VitaliiBlack commented 1 year ago

SAME ISSUE

Risovas commented 1 year ago

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 use use_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 the react-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 that use_frameworks is no longer required. Does anyone have any clue on this?

fontesrp commented 1 year ago

@Risovas did you try the workarounds in #38140? I have yet to find time to try them, but they seem promising.