You need to enable JavaScript to run this app. 为何React Native iOS归档构建在Appcircle CI失败?本地Xcode构建正常
优惠活动
大模型
产品
解决方案
定价
更多

为何React Native iOS归档构建在Appcircle CI失败?本地Xcode构建正常

场景说明
  • 本地Xcode可正常完成iOS归档构建,切换到Appcircle CI环境执行构建时直接报错退出
  • 不允许直接在PodFile中禁用use_flipper:一旦禁用,Pod内置的pre_install/post_install脚本会失效,连本地Xcode构建都会失败
  • 编译失败集中在Flipper相关依赖环节,核心报错日志如下:
** ARCHIVE FAILED **
以下构建命令失败:
    CompileC .../_appcircle_temp/appcircle_export_archive/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Flipper-Folly.build/Objects-normal/armv7/VirtualEventBase.o .../_appcircle_temp/Repository/ios/Pods/Flipper-Folly/folly/io/async/VirtualEventBase.cpp normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'Flipper-Folly' from project 'Pods')

warning: no rule to process file '.../_appcircle_temp/Repository/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'armv7' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '.../_appcircle_temp/Repository/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'armv7' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '.../_appcircle_temp/Repository/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'armv7' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '.../_appcircle_temp/Repository/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '.../_appcircle_temp/Repository/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '.../_appcircle_temp/Repository/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')

进程退出,错误码:1
错误发生步骤:面向设备的Xcode构建
根因
  • 本地构建默认会跳过armv7架构编译流程,Appcircle CI的默认归档配置仍会为32位的armv7架构编译所有依赖;而Flipper-Folly从基础版本开始就不再兼容armv7架构,编译对应C++源码时直接触发错误
  • Flipper-RSocket内置的非代码类文件(Markdown文档、CMake配置)没有从编译流程中排除,因此触发无规则处理文件的警告
  • 本地Xcode因为历史缓存、手动调整过的架构配置跳过了armv7编译,因此可以正常构建,和CI环境的配置存在差异
  • 序列化诊断文件读取失败的警告,是CI环境残留的旧DerivedData缓存导致的,不影响核心逻辑,但会掩盖真实编译错误
修复方案

所有调整都会保留原有use_flipper配置,不会触发pre_install/post_install脚本失效的问题:

  1. 在PodFile的post_install块中,强制为所有Pod目标排除armv7架构,同时清理Flipper-RSocket中的无效非编译文件:
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          # 强制使用标准64位架构,排除废弃的armv7编译
          config.build_settings['ARCHS'] = '$(ARCHS_STANDARD_64_BIT)'
          config.build_settings['EXCLUDED_ARCHS'] = 'armv7'
        end
        # 为Flipper-RSocket移除非编译类文件
        if target.name == 'Flipper-RSocket'
          target.source_build_phase.files.to_a.each do |build_file|
            if build_file.file_ref.name =~ /\.(md|txt|cmake)$/
              target.source_build_phase.remove_file_reference(build_file.file_ref)
            end
          end
        end
      end
    end
    
  2. 在Appcircle CI的项目构建配置中,确认Release模式下的编译架构仅保留arm64,不要把armv7加入目标架构列表
  3. 清空CI环境中的DerivedData、Pods缓存目录后再触发构建,避免旧缓存导致的序列化诊断文件读取警告
  4. 提交调整后的PodFile、Podfile.lock文件到仓库,保证CI环境拉取到和本地一致的依赖配置

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.25 16:54:03