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

Xcode 14更新后EAS本地构建失败问题求助

问题

MacOS系统更新后将Xcode升级至14版本,EAS本地构建无法完成,但提交到EAS远程构建系统可正常运行。由于远程队列等待时间过长,无法满足快速构建.ipa包并安装到真机的需求,急需解决本地构建失败的问题。

报错信息如下:

[RUN_FASTLANE] Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
[RUN_FASTLANE] 2022-09-15 23:36:18.227 xcodebuild[29486:925103]  DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot2/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-21157/DTDeviceKitBase/DTDKRemoteDeviceData.m:382
[RUN_FASTLANE] Details:  (null) deviceType from 00008006-000924391E47002E was NULL when -platform called.
[RUN_FASTLANE] Object:   <DTDKMobileDeviceToken: 0x11640b0d0>
[RUN_FASTLANE] Method:   -platform
[RUN_FASTLANE] Thread:   <NSThread: 0x600000aa0980>{number = 2, name = (null)}
[RUN_FASTLANE] Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
[RUN_FASTLANE] Command timed out after 6 seconds on try 2 of 4, trying again with a 12 second timeout...
[RUN_FASTLANE] 2022-09-15 23:36:22.240 xcodebuild[29486:925141] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
[RUN_FASTLANE] 2022-09-15 23:36:22.240 xcodebuild[29483:925080] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
[RUN_FASTLANE] --- xcodebuild: WARNING: Using the first of multiple matching destinations:
[RUN_FASTLANE] { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00006000-000A103126E2801E }
[RUN_FASTLANE] { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
[RUN_FASTLANE] { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
[RUN_FASTLANE] { platform:iOS Simulator, id:7AD07A6C-05A5-45D7-AE11-C35A755B9BC5, OS:16.0, name:iPhone 14 }
[RUN_FASTLANE] { platform:iOS Simulator, id:413A72BF-7FAA-4A35-B1BA-83DDA8479F7B, OS:16.0, name:iPhone 14 Plus }
[RUN_FASTLANE] { platform:iOS Simulator, id:5E5073DE-9CD5-42E1-8588-D2697E266A77, OS:16.0, name:iPhone 14 Pro }
[RUN_FASTLANE] { platform:iOS Simulator, id:71F46718-DE91-474D-BDA2-9BEE5239A97C, OS:16.0, name:iPhone 14 Pro Max }
[RUN_FASTLANE] { platform:iOS Simulator, id:F3D3CB98-3292-432C-B406-6FDE511CF164, OS:16.0, name:iPhone SE (3rd generation) }
[RUN_FASTLANE] { platform:iOS Simulator, id:7087853B-DF5B-4A63-8C54-ECFBCC9663C8, OS:16.0, name:iPad (9th generation) }
[RUN_FASTLANE] { platform:iOS Simulator, id:BB7BF18B-9A64-4BE1-92F8-7CD5054588BC, OS:16.0, name:iPad Air (5th generation) }
[RUN_FASTLANE] { platform:iOS Simulator, id:60617E87-ED2D-4796-88D2-9B7E12067B07, OS:16.0, name:iPad Pro (11-inch) (3rd generation) }
[RUN_FASTLANE] { platform:iOS Simulator, id:5300781D-B8BA-46E7-B680-182C3A72CC64, OS:16.0, name:iPad Pro (12.9-inch) (5th generation) }
[RUN_FASTLANE] { platform:iOS Simulator, id:349A49C6-E9B7-4B05-925E-DB65DC81FED1, OS:16.0, name:iPad mini (6th generation) }
[RUN_FASTLANE] 2022-09-15 23:36:27.954 xcodebuild[29521:925357] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
[RUN_FASTLANE] Detected provisioning profile mapping: {"com.lifenightsinc.mytally":"fafe1a95-dbec-4868-8f66-e9dcd10adc88"}
[RUN_FASTLANE] 
[RUN_FASTLANE] +--------------------------------------+--------------------------------------+
[RUN_FASTLANE] |                           Summary for gym 2.208.0                           |
[RUN_FASTLANE] +--------------------------------------+--------------------------------------+
[RUN_FASTLANE] | workspace                            | ./MyTally.xcworkspace                |
[RUN_FASTLANE] | scheme                               | MyTally                              |
[RUN_FASTLANE] | clean                                | false                                |
[RUN_FASTLANE] | output_directory                     | ./build                              |
[RUN_FASTLANE] | output_name                          | MyTally                              |
[RUN_FASTLANE] | configuration                        | Release                              |
[RUN_FASTLANE] | silent                               | false                                |
[RUN_FASTLANE] | skip_package_ipa                     | false                                |
[RUN_FASTLANE] | skip_package_pkg                     | false                                |
[RUN_FASTLANE] | export_options.method                | app-store                            |
[RUN_FASTLANE] | export_options.provisioningProfiles  | fafe1a95-dbec-4868-8f66-e9dcd10adc8  |
[RUN_FASTLANE] | .com.lifenightsinc.mytally           | 8                                    |
[RUN_FASTLANE] | export_xcargs                        | OTHER_CODE_SIGN_FLAGS="--keychain    |
[RUN_FASTLANE] |                                      | /var/folders/4z/kv22yhfn6597k5l99c2  |
[RUN_FASTLANE] |                                      | smvm40000gn/T/turtle-v2-a56d594c-4c  |
[RUN_FASTLANE] |                                      | a2-4011-a088-76e19d9df995.keychain"  |
[RUN_FASTLANE] | build_path                           | /Users/umerkiani/Library/Developer/  |
[RUN_FASTLANE] |                                      | Xcode/Archives/2022-09-15            |
[RUN_FASTLANE] | result_bundle                        | false                                |
[RUN_FASTLANE] | buildlog_path                        | /var/folders/4z/kv22yhfn6597k5l99c2  |
[RUN_FASTLANE] |                                      | smvm40000gn/T/eas-build-local-nodej  |
[RUN_FASTLANE] |                                      | s/66e97d3c-42ac-4350-9509-14c3b8d76  |
[RUN_FASTLANE] |                                      | 65e/logs                             |
[RUN_FASTLANE] | destination                          | generic/platform=iOS                 |
[RUN_FASTLANE] | suppress_xcode_output                | true                                 |
[RUN_FASTLANE] | xcodebuild_formatter                 | xcpretty                             |
[RUN_FASTLANE] | disable_xcpretty                     | true                                 |
[RUN_FASTLANE] | skip_profile_detection               | false                                |
[RUN_FASTLANE] | xcodebuild_command                   | xcodebuild                           |
[RUN_FASTLANE] | skip_package_dependencies_resolutio  | false                                |
[RUN_FASTLANE] | n                                    |                                      |
[RUN_FASTLANE] | disable_package_automatic_updates    | false                                |
[RUN_FASTLANE] | use_system_scm                       | false                                |
[RUN_FASTLANE] | xcode_path                           | /Applications/Xcode.app              |
[RUN_FASTLANE] +--------------------------------------+--------------------------------------+
[RUN_FASTLANE] $ set -o pipefail && xcodebuild -workspace ./MyTally.xcworkspace -scheme MyTally -configuration Release -destination 'generic/platform=iOS' -archivePath /Users/umerkiani/Library/Developer/Xcode/Archives/2022-09-15/MyTally\ 2022-09-15\ 23.36.28.xcarchive archive | tee /var/folders/4z/kv22yhfn6597k5l99c2smvm40000gn/T/eas-build-local-nodejs/66e97d3c-42ac-4350-9509-14c3b8d7665e/logs/MyTally-MyTally.log > /dev/null
[RUN_FASTLANE]     Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
[RUN_FASTLANE]     Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyTally' from project 'MyTally')
[RUN_FASTLANE]     Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MyTally' from project 'MyTally')
[RUN_FASTLANE] ▸ ** ARCHIVE FAILED **
[RUN_FASTLANE] ** ARCHIVE FAILED **
[RUN_FASTLANE] Exit status: 65
[RUN_FASTLANE] 
[RUN_FASTLANE] +-------------+-------------------------+
[RUN_FASTLANE] |           Build environment           |
[RUN_FASTLANE] +-------------+-------------------------+
[RUN_FASTLANE] | xcode_path  | /Applications/Xcode.app |
[RUN_FASTLANE] | gym_version | 2.208.0                 |
[RUN_FASTLANE] | sdk         | iPhoneOS16.0.sdk        |
[RUN_FASTLANE] +-------------+-------------------------+
[RUN_FASTLANE] Looks like fastlane ran into a build/archive error with your project
[RUN_FASTLANE] It's hard to tell what's causing the error, so we wrote some guides on how
[RUN_FASTLANE] to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[RUN_FASTLANE] Before submitting an issue on GitHub, please follow the guide above and make
[RUN_FASTLANE] sure your project is set up correctly.
[RUN_FASTLANE] fastlane uses `xcodebuild` commands to generate your binary, you can see the
[RUN_FASTLANE] the full commands printed out in yellow in the above log.
[RUN_FASTLANE] Make sure to inspect the output above, as usually you'll find more error information there
[RUN_FASTLANE] [!] Error building the application - see the log above
[RUN_FASTLANE] Error: Fastlane build failed with unknown error. Please refer to the "Run fastlane" and "Xcode Logs" phases.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
[CLEAN_UP_CREDENTIALS] Destroying keychain - /var/folders/4z/kv22yhfn6597k5l99c2smvm40000gn/T/turtle-v2-a56d594c-4ca2-4011-a088-76e19d9df995.keychain
[CLEAN_UP_CREDENTIALS] Removing provisioning profile

Build failed
Fastlane build failed with unknown error. Please refer to the "Run fastlane" and "Xcode Logs" phases.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
    Error: npx exited with non-zero code: 1

解决方案

1. 修复Xcode 14组件缺失问题

Xcode 14升级后常出现命令行工具或组件缺失,执行以下步骤:

  • 打开Xcode,进入偏好设置 -> 位置,确认命令行工具选择的是Xcode 14版本
  • 重新安装命令行工具:
    sudo rm -rf /Library/Developer/CommandLineTools
    xcode-select --install
    
  • 重启Xcode和终端后再尝试构建

2. 解决设备识别异常

报错中出现设备类型为NULL的提示,说明设备连接或识别有问题:

  • 断开并重新连接iOS真机,在设备上确认信任当前Mac
  • 打开Xcode的窗口 -> 设备与模拟器,移除异常设备后重新添加
  • 清理Xcode缓存:
    killall Xcode
    rm -rf ~/Library/Developer/Xcode/DerivedData
    rm -rf ~/Library/Caches/com.apple.dt.Xcode
    

3. 明确指定EAS构建目标

从警告看,xcodebuild默认选中了macOS目标,需强制指定iOS平台:

  • 修改项目根目录的eas.json,在iOS构建配置中明确目标:
    {
      "build": {
        "development": {
          "developmentClient": true,
          "distribution": "internal",
          "ios": {
            "destination": "generic/platform=iOS",
            "xcode": "14.0"
          }
        }
      }
    }
    
  • 构建时手动指定参数:
    eas build --platform ios --local --destination 'generic/platform=iOS'
    

4. 升级Fastlane适配Xcode 14

当前使用的gym版本(2.208.0)与Xcode 14兼容性不足,升级Fastlane:

# 使用bundle管理的项目
bundle update fastlane
# 全局安装
sudo gem install fastlane -NV

5. 修复脚本构建阶段警告(可选)

报错中提到的无输出依赖警告,虽不直接导致构建失败,但可避免潜在问题:

  • 打开Xcode项目,进入对应运行脚本构建阶段
  • 取消勾选基于依赖分析,强制脚本每次构建都运行
  • 或添加输出文件路径,比如给Bundle React Native code and images脚本添加输出:$(BUILT_PRODUCTS_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/main.jsbundle

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.19 13:15:31