You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native iOS构建失败:找不到react/debug/react_native_assert.h文件

iOS构建React Native应用报错:'react/debug/react_native_assert.h' file not found

我在iOS平台运行React Native应用时遭遇构建错误,具体报错信息如下:

yordex-app/node_modules/react-native/ReactCommon/react/utils/RunLoopObserver.cpp:10:10: 'react/debug/react_native_assert.h' file not found

该应用在Android上运行完全正常,但iOS端的这个问题已经持续多日,我尝试了GitHub上多种修复方案都没能解决。

我的技术版本信息:

  • React Native 0.73.0
  • React 18.2.0
  • Xcode 16.2.0

以下是我的Podfile配置:

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")

# require_relative '../node_modules/react-native-unimodules/cocoapods.rb'

# 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, '14.0'
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
end

pod 'ReactNativeKeyboardManager', :path => '../node_modules/react-native-keyboard-manager'

pod 'react-native-in-app-review', :path => '../node_modules/react-native-in-app-review'
pod 'Stripe'



target 'yordex' do
  use_expo_modules!
  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
  config = use_native_modules!
  use_frameworks! :linkage => :static
  use_react_native!(
    :path => config[:reactNativePath],
    :flipper_configuration => FlipperConfiguration.disabled ,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )




  target 'yordexTests' 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
    )

    installer.pods_project.targets.each do |target|
      if target.name == "React-Core.common-AccessibilityResources"
       target.remove_from_project
      end
    end

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
      end
    end

    installer.pods_project.targets.each do |target|
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
    end
  end
end

请问有没有人知道该如何解决这个问题?

内容的提问来源于stack exchange,提问作者Kanwarjeet Singh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 11:01:20