Skip to content

iOS Build failing: ReactCommon/RCTHost.h file not found with react-native-navigation 8.2.1 on React Native 0.77.2Β #8094

@adeelSkills

Description

@adeelSkills

What happened?

Hi,

I’m trying to build my React Native project (RN 0.77.2) with react-native-navigation 8.2.1 on iOS, but the build keeps failing in Xcode with the following error:

'ReactCommon/RCTHost.h' file not found

What I did

Using react-native-navigation 8.2.1

iOS build through Xcode (also fails via npx react-native run-ios)

Followed existing fixes for import paths

Manually edited the library to point to the correct RCTHost paths (based on React Native 0.66.1 structure)

Ran pod deintegrate && pod install --repo-update

Cleaned DerivedData and reinstalled node_modules

Tried patch-package to persist the fix

But after doing all of this, the build still fails with the same RCTHost.h not found error.

my podfile =

require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', dir]).strip

platform :ios, '16.4'

pod 'Firebase/CoreOnly', '11.13.0'
pod 'Firebase/DynamicLinks', '11.13.0'
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
$RNFirebaseAsStaticFramework = true

prepare_react_native_project!

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

target 'eurecab' do
config = use_native_modules!

use_react_native!(
:path => config[:reactNativePath],
:app_path => "#{Pod::Config.instance.installation_root}/..",
:hermes_enabled => true,
:fabric_enabled => false,
:new_arch_enabled => false
)

post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.4'
config.build_settings['SWIFT_VERSION'] = '5.0'
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++20'

    extra_headers = [
      "${PODS_ROOT}/Headers/Private/React-RuntimeCore",
      "${PODS_ROOT}/Headers/Private/React-debug",
      "${PODS_ROOT}/Headers/Private/React-jserrorhandler",
      "${PODS_ROOT}/Headers/Private/React-jsinspector",
      "${PODS_ROOT}/Headers/Private/React-runtimescheduler",
      "${PODS_ROOT}/Headers/Private/React-performancetimeline",
      "${PODS_ROOT}/Headers/Private/React-rendererconsistency"
    ]
    config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited)'
    config.build_settings['HEADER_SEARCH_PATHS'] << " " + extra_headers.join(" ")

    config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= '$(inherited)'
    config.build_settings['FRAMEWORK_SEARCH_PATHS'] << " ${PODS_CONFIGURATION_BUILD_DIR}/React-RuntimeApple"

    config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
  end
end

end
end

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

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

Help us reproduce this issue!

No response

In what environment did this happen?

React Native Navigation version:
React Native version:
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version:
Device model:
iOS version:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions