react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

New Architecture - Builds fail when Podfile uses static linking

Open kevin-madden-gf opened this issue 7 months ago • 8 comments

What happened?

When using static frameworks in the Podfile:

Use static frameworks

use_frameworks! :linkage => :static

Build fail with an error in RNNButtonView (RCTHost.h file not found) - see the image from Xcode below:

Image

Static linking is required for some packages, e.g. react-native-firebase.

This seems to have something to do with the builds that support new architecture. Build 8.0.0 with new architecture disabled builds fine.

What was the expected behaviour?

The build completes without issue.

Was it tested on latest react-native-navigation?

  • [x] I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

Try using a Podfile like the one below, on 8.1.0 RC1, to replicate

$RNFirebaseAsStaticFramework = true
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, '15.1'
prepare_react_native_project!

# Use static frameworks
use_frameworks! :linkage => :static

config = use_native_modules!

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'AwesomeProject' do
  ENV['RCT_NEW_ARCH_ENABLED'] = '1'

  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    :hermes_enabled => true
  )
  
    pod 'Firebase', :modular_headers => true
    pod 'FirebaseCore', :modular_headers => true
    pod 'FirebaseCoreInternal', :modular_headers => true
    pod 'GoogleUtilities', :modular_headers => true

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

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      # :ccache_enabled => true
    )
  end
end

In what environment did this happen?

React Native Navigation version: 8.1.0 RC1 React Native version: 0.76.9 Has Fabric (React Native's new rendering system) enabled: (yes/no) yes Node version: 22 Device model: iPhone 11 iOS version: 18.1

kevin-madden-gf avatar May 20 '25 18:05 kevin-madden-gf

My build fails at different point but this bit is working. I have this line use_frameworks! :linkage => :static completely removed. What I have instead is $RNFirebaseAsStaticFramework = true. It sits below modular headers.

pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
$RNFirebaseAsStaticFramework = true

ivosw avatar May 21 '25 14:05 ivosw

My build fails at different point but this bit is working. I have this line use_frameworks! :linkage => :static completely removed. What I have instead is $RNFirebaseAsStaticFramework = true. It sits below modular headers.

pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
$RNFirebaseAsStaticFramework = true

Thanks for the update. After applying this change, the build failure issue was resolved. However, now the app gets stuck on the splash screen. I checked the logs in Xcode, but I couldn't identify a clear reason for the issue. Let me know if you have any suggestions or if there's anything specific I should look into. @ivosw @kevin-madden-gf

batuctn avatar May 23 '25 12:05 batuctn

for Firebase you must you must use use_frameworks! :linkage => :static, anyone that uses modular_headers stuff in their Podfile is going to have compilation problems https://github.com/invertase/react-native-firebase/issues/8271#issuecomment-2651573373

manuhook avatar May 27 '25 20:05 manuhook

for Firebase you must you must use use_frameworks! :linkage => :static, anyone that uses modular_headers stuff in their Podfile is going to have compilation problems invertase/react-native-firebase#8271 (comment)

@manuhook I applied use_frameworks! :linkage => :static and removed all modular_headers. But now I’m getting the same RCTHost.h file not found error mentioned earlier. Any ideas how to fix this without reverting changes?

batuctn avatar May 29 '25 06:05 batuctn

for Firebase you must you must use use_frameworks! :linkage => :static, anyone that uses modular_headers stuff in their Podfile is going to have compilation problems invertase/react-native-firebase#8271 (comment)

@manuhook I applied use_frameworks! :linkage => :static and removed all modular_headers. But now I’m getting the same RCTHost.h file not found error mentioned earlier. Any ideas how to fix this without reverting changes?

I have the same error, I didn't find a solution for the moment :(

manuhook avatar May 29 '25 07:05 manuhook

I think I’ve resolved the errors related to

use_frameworks! :linkage => :static

Tested with RNN 8.0.0 and React Native 0.76.7 - New Arch enabled.

You need to modify the ReactNativeNavigation.podspec file as follows:

require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'

Pod::Spec.new do |s|
  s.name         = "ReactNativeNavigation"
  s.version      = package['version']
  s.summary      = package['description']

  s.authors      = "Wix.com"
  s.homepage     = package['homepage']
  s.license      = package['license']
  s.platform     = :ios, "11.0"

  s.module_name  = 'ReactNativeNavigation'
  s.default_subspec = 'Core'

  s.subspec 'Core' do |ss|
    s.source              = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
    s.source_files    = 'lib/ios/**/*.{h,m,mm,cpp}'
    s.exclude_files       = "lib/ios/ReactNativeNavigationTests/**/*.*", "lib/ios/OCMock/**/*.*"
  end

  if fabric_enabled
    install_modules_dependencies(s)

    folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -Wno-comma -Wno-shorten-64-to-32'
    fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
    header_search_paths = [
      '"$(PODS_ROOT)/Headers/Private/React-Core"', # as React-RCTAppDelegate.podspec to access JSCExecutorFactory.h
      '"$(PODS_ROOT)/boost"',
      '"$(PODS_ROOT)/boost-for-react-native"',
      '"$(PODS_ROOT)/RCT-Folly"',
      '"$(PODS_ROOT)/Headers/Private/Yoga"',
      '"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector/jsinspector_modern.framework/Headers"',
    ]
    if fabric_enabled
      header_search_paths.concat([
        # [begin] transitive dependencies of React-RCTAppDelegate that are not defined modules
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeApple/React_RuntimeApple.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeCore/React_RuntimeCore.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-jserrorhandler/React_jserrorhandler.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererdebug/React_rendererdebug.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-nativeconfig/React_nativeconfig.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTAppDelegate/React_RCTAppDelegate.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-performancetimeline/React_performancetimeline.framework/Headers"',
        '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererconsistency/React_rendererconsistency.framework/Headers"',
        # [end] transitive dependencies of React-RCTAppDelegate that are not defined modules
      ])
    end
    s.pod_target_xcconfig = {
      'HEADER_SEARCH_PATHS' => header_search_paths.join(' '),
      "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
      "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
    }

    s.compiler_flags  = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED'
    s.requires_arc    = true

    s.dependency "React"
    s.dependency "React-Core"
    s.dependency "React-RCTFabric"
    s.dependency "React-cxxreact"
    s.dependency "React-Fabric"
    s.dependency "React-Codegen"
    s.dependency "RCT-Folly"
    s.dependency "RCTRequired"
    s.dependency "RCTTypeSafety"
    s.dependency "ReactCommon/turbomodule/core"
    s.dependency "React-runtimeexecutor"
    s.dependency "React-rncore"
  end

  s.dependency 'React-Core'
  s.dependency 'React-CoreModules'
  s.dependency 'React-RCTImage'
  s.dependency 'React-RCTText'
  s.dependency 'HMSegmentedControl'
  s.frameworks = 'UIKit'
end

Now I have this error but I believe it's not linked to use_frameworks! :linkage => :static https://github.com/wix/react-native-navigation/issues/7980

manuhook avatar Jun 02 '25 17:06 manuhook

Could anyone with knowledge about this issue point us in a direction? My understanding is that the imports/headers need to be resolved somehow for the New Architecture + static linking combination?

lichstam avatar Jun 06 '25 19:06 lichstam

You need to modify the ReactNativeNavigation.podspec file as follows:

I tested it my app [email protected] with [email protected] , it doesn't help

/Users/app/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h:2:9: 
   'React-RuntimeApple/ReactCommon/RCTHost.h' file not found

retyui avatar Jun 17 '25 12:06 retyui

Please check this in the React-RuntimeApple Podspec. The module name is changed if use_frameworks is used in the Podfile. It could be resolved by changing React-RuntimeApple/ to React_RuntimeApple/ when importing it.

  if ENV['USE_FRAMEWORKS']
    s.header_mappings_dir     = './'
    s.module_name             = 'React_RuntimeApple'
  end

peteAhn avatar Jun 20 '25 09:06 peteAhn

Please check this in the React-RuntimeApple Podspec. The module name is changed if use_frameworks is used in the Podfile. It could be resolved by changing React-RuntimeApple/ to React_RuntimeApple/ when importing it.

if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' s.module_name = 'React_RuntimeApple' end

so the change they do in the if statement is causing the problem?

lichstam avatar Jun 26 '25 08:06 lichstam

Please check this in the React-RuntimeApple Podspec. The module name is changed if use_frameworks is used in the Podfile. It could be resolved by changing React-RuntimeApple/ to React_RuntimeApple/ when importing it. if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' s.module_name = 'React_RuntimeApple' end

so the change they do in the if statement is causing the problem?

Correct, if you used static linking, the import path, which is the header path, will be changed. If we only want to fix this line, you can write the following.

#import <React_RuntimeApple/ReactCommon/RCTHost.h>

peteAhn avatar Jun 27 '25 04:06 peteAhn

#import <React_RuntimeApple/ReactCommon/RCTHost.h> /Users/razord/Documents/Spraxa/CoolR-RN/CoolR-BLE-Hybrid/CoolR_ReactNative/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h:8:9 'React-RuntimeApple/ReactCommon/RCTHost.h' file not found

the same issue comes in RN - 0.80.1 , RNN - 8.1.0-rc02

manoj-mehra-spraxa avatar Jul 22 '25 07:07 manoj-mehra-spraxa

+1 I changed to #import <React_RuntimeApple/ReactCommon/RCTHost.h> then another error of JSRuntimeFactory.h appeared.

Image

manhbuithe avatar Aug 12 '25 17:08 manhbuithe

We fixed a linking problem in [email protected] but [email protected] also fixes more missing necessities. See if you have any luck with the latest version.

markdevocht avatar Aug 12 '25 19:08 markdevocht

I tried 8.2.1, the error also occurs

manhbuithe avatar Aug 13 '25 00:08 manhbuithe

Me too, I tried 8.2.1, 8.1.2 and 8.1.1 (all with "react-native": "0.77.2"). this is what I see.

Image

ghashi avatar Aug 13 '25 02:08 ghashi

Please check this in the React-RuntimeApple Podspec. The module name is changed if use_frameworks is used in the Podfile. It could be resolved by changing React-RuntimeApple/ to React_RuntimeApple/ when importing it. if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' s.module_name = 'React_RuntimeApple' end

so the change they do in the if statement is causing the problem?

Correct, if you used static linking, the import path, which is the header path, will be changed. If we only want to fix this line, you can write the following.

#import <React_RuntimeApple/ReactCommon/RCTHost.h>

@peteAhn After changing to import <React_RuntimeApple/ReactCommon/RCTHost.h>, did you see any other errors?

manhbuithe avatar Aug 13 '25 08:08 manhbuithe

✅ I was able to build the app with [email protected] and use_frameworks! :linkage => :static enabled

here is my diff:

diff --git a/node_modules/react-native-navigation/ReactNativeNavigation.podspec b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
index 1777dc6..de4122d 100644
--- a/node_modules/react-native-navigation/ReactNativeNavigation.podspec
+++ b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
@@ -51,9 +51,39 @@ Pod::Spec.new do |s|
 
   folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DFOLLY_CFG_NO_COROUTINES=1'
 
+  header_search_paths = [
+    "$(PODS_ROOT)/boost",
+    "$(PODS_ROOT)/boost-for-react-native",
+    "$(PODS_ROOT)/RCT-Folly",
+    "$(PODS_ROOT)/Headers/Private/React-Core",
+    "$(PODS_ROOT)/Headers/Private/Yoga",
+  ]
+
+
+  if fabric_enabled && ENV['USE_FRAMEWORKS']
+    header_search_paths.concat([
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricComponents/React_FabricComponents.framework/Headers/react/renderer/textlayoutmanager/platform/ios"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricComponents/React_FabricComponents.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-nativeconfig/React_nativeconfig.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeApple/React_RuntimeApple.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeCore/React_RuntimeCore.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-performancetimeline/React_performancetimeline.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererconsistency/React_rendererconsistency.framework/Headers"',
+      '"$(PODS_ROOT)/Headers/Public/ReactCommon"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-jserrorhandler/React_jserrorhandler.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/folly.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/fmt/fmt.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererdebug/React_rendererdebug.framework/Headers"',
+      '"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector/jsinspector_modern.framework/Headers"',
+    ])
+  end
+
   # Base xcconfig settings
   xcconfig_settings = {
-      'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native"  "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
+      'HEADER_SEARCH_PATHS' => header_search_paths.join(' '),
       "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
       "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
   }
diff --git a/node_modules/react-native-navigation/autolink/postlink/run.js b/node_modules/react-native-navigation/autolink/postlink/run.js
old mode 100755
new mode 100644
diff --git a/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm b/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm
index fe03a35..5338e73 100644
--- a/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm
+++ b/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm
@@ -1,7 +1,7 @@
 #import "RNNEventEmitter.h"
 #import "RNNUtils.h"
 #import "RNNTurboEventEmitter.h"
-#import <React-RuntimeApple/ReactCommon/RCTHost.h>
+#import <ReactCommon/RCTHost.h>
 
 @implementation RNNEventEmitter { }
 
diff --git a/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h b/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h
index 6dd7d74..298a1de 100644
--- a/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h
+++ b/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h
@@ -1,5 +1,5 @@
 #import "RNNComponentView.h"
-#import <React-RuntimeApple/ReactCommon/RCTHost.h>
+#import <ReactCommon/RCTHost.h>
 #import <React/RCTSurfacePresenterStub.h>
 #import <React/RCTFabricSurface.h>
 #import <React/RCTSurfacePresenter.h>
diff --git a/node_modules/react-native-navigation/lib/ios/RNNReactView.mm b/node_modules/react-native-navigation/lib/ios/RNNReactView.mm
index 1d28787..45a2c10 100644
--- a/node_modules/react-native-navigation/lib/ios/RNNReactView.mm
+++ b/node_modules/react-native-navigation/lib/ios/RNNReactView.mm
@@ -3,7 +3,7 @@
 #import <React/RCTRootContentView.h>
 
 #ifdef RCT_NEW_ARCH_ENABLED
-#import <React-RuntimeApple/ReactCommon/RCTHost.h>
+#import <ReactCommon/RCTHost.h>
 #import <React/RCTFabricSurface.h>
 #import <React/RCTSurfacePresenter.h>
 
diff --git a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h
index 0c8f231..21ec6b1 100644
--- a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h
+++ b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h
@@ -4,7 +4,7 @@
 #import <UIKit/UIKit.h>
 
 #ifdef RCT_NEW_ARCH_ENABLED
-#import <React-RuntimeApple/ReactCommon/RCTHost.h>
+#import <ReactCommon/RCTHost.h>
 #import "RNNTurboManager.h"
 #endif
 
diff --git a/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h b/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h
index 4d3c7f9..46c6f3f 100644
--- a/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h
+++ b/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h
@@ -5,7 +5,7 @@
 #import <React/RCTUIManagerUtils.h>
 
 #ifdef RCT_NEW_ARCH_ENABLED
-#import <React-RuntimeApple/ReactCommon/RCTHost.h>
+#import <ReactCommon/RCTHost.h>
 #import <React/RCTSurfacePresenterStub.h>
 #endif
 
diff --git a/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm b/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm
index cd429d3..52c2748 100644
--- a/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm
+++ b/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm
@@ -9,7 +9,7 @@
 #import "RNNReactComponentRegistry.h"
 #import "RNNReactRootViewCreator.h"
 #import "RNNTurboCommandsHandler.h"
-#import <React-RuntimeApple/ReactCommon/RCTHost.h>
+#import <ReactCommon/RCTHost.h>
 
 @interface RNNTurboManager ()
 

retyui avatar Aug 13 '25 20:08 retyui

✅ I was able to build the app with [email protected] and use_frameworks! :linkage => :static enabled

here is my diff:

diff --git a/node_modules/react-native-navigation/ReactNativeNavigation.podspec b/node_modules/react-native-navigation/ReactNativeNavigation.podspec index 1777dc6..de4122d 100644 --- a/node_modules/react-native-navigation/ReactNativeNavigation.podspec +++ b/node_modules/react-native-navigation/ReactNativeNavigation.podspec @@ -51,9 +51,39 @@ Pod::Spec.new do |s|

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DFOLLY_CFG_NO_COROUTINES=1'

  • header_search_paths = [
  • "$(PODS_ROOT)/boost",
  • "$(PODS_ROOT)/boost-for-react-native",
  • "$(PODS_ROOT)/RCT-Folly",
  • "$(PODS_ROOT)/Headers/Private/React-Core",
  • "$(PODS_ROOT)/Headers/Private/Yoga",
  • ]
  • if fabric_enabled && ENV['USE_FRAMEWORKS']
  • header_search_paths.concat([
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricComponents/React_FabricComponents.framework/Headers/react/renderer/textlayoutmanager/platform/ios"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricComponents/React_FabricComponents.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-nativeconfig/React_nativeconfig.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeApple/React_RuntimeApple.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeCore/React_RuntimeCore.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-performancetimeline/React_performancetimeline.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererconsistency/React_rendererconsistency.framework/Headers"',
    
  •  '"$(PODS_ROOT)/Headers/Public/ReactCommon"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-jserrorhandler/React_jserrorhandler.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/folly.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/fmt/fmt.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererdebug/React_rendererdebug.framework/Headers"',
    
  •  '"${PODS_CONFIGURATION_BUILD_DIR}/React-jsinspector/jsinspector_modern.framework/Headers"',
    
  • ])
  • end
  • Base xcconfig settings

    xcconfig_settings = {
  •  'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native"  "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
    
  •  'HEADER_SEARCH_PATHS' => header_search_paths.join(' '),
     "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
     "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
    
    } diff --git a/node_modules/react-native-navigation/autolink/postlink/run.js b/node_modules/react-native-navigation/autolink/postlink/run.js old mode 100755 new mode 100644 diff --git a/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm b/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm index fe03a35..5338e73 100644 --- a/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm +++ b/node_modules/react-native-navigation/lib/ios/RNNEventEmitter.mm @@ -1,7 +1,7 @@ #import "RNNEventEmitter.h" #import "RNNUtils.h" #import "RNNTurboEventEmitter.h" -#import <React-RuntimeApple/ReactCommon/RCTHost.h> +#import <ReactCommon/RCTHost.h>

@implementation RNNEventEmitter { }

diff --git a/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h b/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h index 6dd7d74..298a1de 100644 --- a/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h +++ b/node_modules/react-native-navigation/lib/ios/RNNReactButtonView.h @@ -1,5 +1,5 @@ #import "RNNComponentView.h" -#import <React-RuntimeApple/ReactCommon/RCTHost.h> +#import <ReactCommon/RCTHost.h> #import <React/RCTSurfacePresenterStub.h> #import <React/RCTFabricSurface.h> #import <React/RCTSurfacePresenter.h> diff --git a/node_modules/react-native-navigation/lib/ios/RNNReactView.mm b/node_modules/react-native-navigation/lib/ios/RNNReactView.mm index 1d28787..45a2c10 100644 --- a/node_modules/react-native-navigation/lib/ios/RNNReactView.mm +++ b/node_modules/react-native-navigation/lib/ios/RNNReactView.mm @@ -3,7 +3,7 @@ #import <React/RCTRootContentView.h>

#ifdef RCT_NEW_ARCH_ENABLED -#import <React-RuntimeApple/ReactCommon/RCTHost.h> +#import <ReactCommon/RCTHost.h> #import <React/RCTFabricSurface.h> #import <React/RCTSurfacePresenter.h>

diff --git a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h index 0c8f231..21ec6b1 100644 --- a/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h +++ b/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.h @@ -4,7 +4,7 @@ #import <UIKit/UIKit.h>

#ifdef RCT_NEW_ARCH_ENABLED -#import <React-RuntimeApple/ReactCommon/RCTHost.h> +#import <ReactCommon/RCTHost.h> #import "RNNTurboManager.h" #endif

diff --git a/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h b/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h index 4d3c7f9..46c6f3f 100644 --- a/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h +++ b/node_modules/react-native-navigation/lib/ios/ScreenAnimationController.h @@ -5,7 +5,7 @@ #import <React/RCTUIManagerUtils.h>

#ifdef RCT_NEW_ARCH_ENABLED -#import <React-RuntimeApple/ReactCommon/RCTHost.h> +#import <ReactCommon/RCTHost.h> #import <React/RCTSurfacePresenterStub.h> #endif

diff --git a/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm b/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm index cd429d3..52c2748 100644 --- a/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm +++ b/node_modules/react-native-navigation/lib/ios/TurboModules/RNNTurboManager.mm @@ -9,7 +9,7 @@ #import "RNNReactComponentRegistry.h" #import "RNNReactRootViewCreator.h" #import "RNNTurboCommandsHandler.h" -#import <React-RuntimeApple/ReactCommon/RCTHost.h> +#import <ReactCommon/RCTHost.h>

@interface RNNTurboManager ()

ReactNativeNavigation/ReactNativeNavigation.h' file not found

after i patched, RNN 8.2.0

lichstam avatar Aug 14 '25 11:08 lichstam

@lichstam Do you use AppDelegate.swift or AppDelegate.mm / AppDelegate.m ?

if it's a Object C or C++, please make sure you see the next msg during pod install

ReactNativeNavigation: Objective-C AppDelegate detected - using standard configuration

in case of ReactNativeNavigation: Swift AppDelegate detected - enabling Swift-compatible configuration try to hard code the next in a file react-native-navigation/ReactNativeNavigation.podspec

-swift_project = swift_delegate_path && File.exist?(swift_delegate_path)
+swift_project = false; # swift_delegate_path && File.exist?(swift_delegate_path)

retyui avatar Aug 14 '25 11:08 retyui

@lichstam Do you use AppDelegate.swift or AppDelegate.mm / AppDelegate.m ?

if it's a Object C or C++, please make sure you see the next msg during pod install

ReactNativeNavigation: Objective-C AppDelegate detected - using standard configuration

in case of ReactNativeNavigation: Swift AppDelegate detected - enabling Swift-compatible configuration try to hard code the next in a file react-native-navigation/ReactNativeNavigation.podspec

-swift_project = swift_delegate_path && File.exist?(swift_delegate_path) +swift_project = false; # swift_delegate_path && File.exist?(swift_delegate_path)

thanks! managed to build it now successfully but i get a blank black screen. not sure if it's rnn or something else. i'll try to invest more time into this the coming days

lichstam avatar Aug 14 '25 21:08 lichstam

+1 I changed to #import <React_RuntimeApple/ReactCommon/RCTHost.h> then another error of JSRuntimeFactory.h appeared.

Image

I have the same error. Is there a solution?

ertugruldogan avatar Aug 15 '25 20:08 ertugruldogan

thanks! managed to build it now successfully but i get a blank black screen. not sure if it's rnn or something else. i'll try to invest more time into this the coming days

Please use the latest version of RNN

retyui avatar Aug 17 '25 12:08 retyui

Please check this in the React-RuntimeApple Podspec. The module name is changed if use_frameworks is used in the Podfile. It could be resolved by changing React-RuntimeApple/ to React_RuntimeApple/ when importing it. if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' s.module_name = 'React_RuntimeApple' end

so the change they do in the if statement is causing the problem?

Correct, if you used static linking, the import path, which is the header path, will be changed. If we only want to fix this line, you can write the following. #import <React_RuntimeApple/ReactCommon/RCTHost.h>

@peteAhn After changing to import <React_RuntimeApple/ReactCommon/RCTHost.h>, did you see any other errors?

Of course, you will also encounter other errors. I just pointed out a change in the Podspec.

peteAhn avatar Aug 18 '25 11:08 peteAhn

The same error occurred with React Native 0.77.3 and React Native Navigation 8.3.0.

peteAhn avatar Aug 20 '25 12:08 peteAhn

+1 I changed to #import <React_RuntimeApple/ReactCommon/RCTHost.h> then another error of JSRuntimeFactory.h appeared.

Image

Anyone able to fix this one?

witaloriver avatar Aug 20 '25 12:08 witaloriver

@witaloriver @peteAhn @ertugruldogan

  1. Use the latest ver. of RNN
  2. React Native 0.77.x
  3. Patch RNN: https://github.com/wix/react-native-navigation/issues/8026#issuecomment-3185537847
  4. Force to use c++ ONLY if you are not migrated to swift https://github.com/wix/react-native-navigation/issues/8026#issuecomment-3188163665

retyui avatar Aug 20 '25 13:08 retyui

@witaloriver @peteAhn @ertugruldogan

  1. Use the latest ver. of RNN
  2. Patch RNN: New Architecture - Builds fail when Podfile uses static linking #8026 (comment)
  3. Force to use c++ ONLY if you are not migrated to swift New Architecture - Builds fail when Podfile uses static linking #8026 (comment)

I already did those. The JsRuntimeFactory.h file not found error still exists.

Oh, one note is that I'm on react-native version 0.80

witaloriver avatar Aug 20 '25 13:08 witaloriver

React-Native 0.80.x and 0.81.x

The JsRuntimeFactory.h file not found error still exists.

ertugruldogan avatar Aug 20 '25 13:08 ertugruldogan

@ertugruldogan @witaloriver currently only react native 77 is officially supported

https://github.com/wix/react-native-navigation/blob/1ed07f4a42cf9677cbd31386473d2ea81158db67/website/docs/docs/docs-Installing.mdx?plain=1#L10

retyui avatar Aug 20 '25 14:08 retyui