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

iOS Fastlane打包失败(Exit Status 65):重复输出文件问题求助

解决Xcode归档Exit Status 65:重复Manifest.lock检查脚本冲突问题

问题情况

运行beta预发布lane时归档失败,错误码Exit Status 65,核心报错为多个命令生成同一个Pods-ATPAutoteileProd-checkManifestLockResult.txt文件。staging lane运行正常,仅scheme配置存在差异。排查确认:添加Detox测试后,project.pbxproj文件中新增了一个与原有[CP] Check Pods Manifest.lock完全重复的ShellScript构建步骤,导致输出文件冲突。

错误日志

❌  error: Multiple commands produce '/Users/user/Library/Developer/Xcode/DerivedData/ATPAutoteile-ewiwulmkdtysbjegycpawxyttoab/Build/Intermediates.noindex/ArchiveIntermediates/ATPAutoteileProd/IntermediateBuildFilesPath/ATPAutoteile.build/Release-iphoneos/ATPAutoteileProd.build/DerivedSources/Pods-ATPAutoteileProd-checkManifestLockResult.txt'

    duplicate output file '/Users/user/Library/Developer/Xcode/DerivedData/ATPAutoteile-ewiwulmkdtysbjegycpawxyttoab/Build/Intermediates.noindex/ArchiveIntermediates/ATPAutoteileProd/IntermediateBuildFilesPath/ATPAutoteile.build/Release-iphoneos/ATPAutoteileProd.build/DerivedSources/Pods-ATPAutoteileProd-checkManifestLockResult.txt' on task: PhaseScriptExecution [CP] Check Pods Manifest.lock /Users/user/Library/Developer/Xcode/DerivedData/ATPAutoteile-ewiwulmkdtysbjegycpawxyttoab/Build/Intermediates.noindex/ArchiveIntermediates/ATPAutoteileProd/IntermediateBuildFilesPath/ATPAutoteile.build/Release-iphoneos/ATPAutoteileProd.build/Script-B98B4A1A51B148FF9682C9F2.sh (in target 'ATPAutoteileProd' from project 'ATPAutoteile')
** ARCHIVE FAILED **
[09:52:57]: Exit status: 65

日志详情:

error: Multiple commands produce '/Users/user/Library/Developer/Xcode/DerivedData/ATPAutoteile-ewiwulmkdtysbjegycpawxyttoab/Build/Intermediates.noindex/ArchiveIntermediates/ATPAutoteileProd/IntermediateBuildFilesPath/ATPAutoteile.build/Release-iphoneos/ATPAutoteileProd.build/DerivedSources/Pods-ATPAutoteileProd-checkManifestLockResult.txt'
    note: That command depends on command in Target 'ATPAutoteileProd' (project 'ATPAutoteile'): script phase “Run Script”
    note: That command depends on command in Target 'ATPAutoteileProd' (project 'ATPAutoteile'): script phase “[CP] Check Pods Manifest.lock”

重复脚本对比

新增的无命名重复脚本:

DE0C3FC267A3918F85ED3A32 /* ShellScript */ = {
    isa = PBXShellScriptBuildPhase;
    buildActionMask = 2147483647;
    files = (
    );
    outputPaths = (
        "$(DERIVED_FILE_DIR)/Pods-ATPAutoteileProd-checkManifestLockResult.txt",
    );
    runOnlyForDeploymentPostprocessing = 0;
    shellPath = /bin/sh;
    shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
    showEnvVarsInLog = 0;
};

原有带命名的官方脚本:

A31E9DFB76A71B2800EDF265 /* [CP] Check Pods Manifest.lock */ = {
            isa = PBXShellScriptBuildPhase;
            buildActionMask = 2147483647;
            dependencyFile = "$(DERIVED_FILES_DIR)/$(INPUT_FILE_PATH).d";
            files = (
            );
            inputFileListPaths = (
            );
            inputPaths = (
                "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
                "${PODS_ROOT}/Manifest.lock",
            );
            name = "[CP] Check Pods Manifest.lock";
            outputFileListPaths = (
            );
            outputPaths = (
                "$(DERIVED_FILE_DIR)/Pods-ATPAutoteileProd-checkManifestLockResult.txt",
            );
            runOnlyForDeploymentPostprocessing = 0;
            shellPath = /bin/sh;
            shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
        };

解决方案

方法1:通过Xcode可视化操作删除重复脚本

  • 打开Xcode项目,选中ATPAutoteileProd target
  • 切换到Build Phases标签页
  • 找到未命名的Run Script阶段(对应新增的重复脚本),点击左上角的-按钮删除
  • 执行pod install重新同步Pod配置
  • 重新运行beta lane归档

方法2:直接编辑project.pbxproj文件删除重复脚本

  • 找到项目根目录下的project.pbxproj文件,用文本编辑器打开
  • 搜索并删除新增的脚本块(即DE0C3FC267A3918F85ED3A32 /* ShellScript */ = { ... };整个段落)
  • 搜索该脚本的UUID(DE0C3FC267A3918F85ED3A32),删除target的buildPhases数组中对应的引用
  • 保存文件后,执行pod install
  • 重新运行beta lane归档

注意:删除时务必确认不要误删原有带[CP] Check Pods Manifest.lock命名的官方脚本。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.22 00:06:18