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

执行flutter run在实体iPhone运行时遇iOS构建失败求助

解决Flutter运行到iPhone时Xcode构建失败(resultBundlePath文件已存在)

问题重现

执行flutter run将Flutter应用部署到实体iPhone时,出现以下报错:

Automatically signing iOS for device deployment using specified development team in Xcode project: U82S29GYHT
Xcode build failed due to concurrent builds, will retry in 2 seconds.
Running Xcode build...                                                   
Xcode build done.                                           113.8s
Failed to build iOS app
Could not build the precompiled application for the device.
Error output from Xcode build:
↳
    2023-08-08 21:56:45.845 xcodebuild[60532:459242] Requested but did not find extension point with identifier
    Xcode.IDEFoundation.IDEResultKitSerializationConverter
    xcodebuild: error: Existing file at -resultBundlePath
    "/var/folders/qc/r59z7mgx0v18zk6397764cz00000gn/T/flutter_tools.JRawz4/flutter_ios_build_temp_dir5qvG7L/temporary_xc
    result_bundle.xcresult"

解决方案

  • 清理项目构建缓存

    1. 终端进入项目根目录,执行:flutter clean
    2. 进入iOS子目录:cd ios,执行:pod deintegrate && pod install
  • 删除Xcode临时构建文件

    1. 直接删除报错中指定的已存在文件:
      rm -rf "/var/folders/qc/r59z7mgx0v18zk6397764cz00000gn/T/flutter_tools.JRawz4/flutter_ios_build_temp_dir5qvG7L/temporary_xcresult_bundle.xcresult"
      
    2. 或者清理Xcode的Derived Data:打开Xcode → Xcode > Settings > Locations,点击Derived Data路径旁的箭头,删除文件夹内所有内容
  • 终止残留进程并重启构建

    1. 关闭Xcode和当前终端窗口
    2. 执行命令杀掉所有xcodebuild进程:killall xcodebuild
    3. 重新打开终端,进入项目目录执行flutter run
  • 检查版本兼容性

    1. 升级Flutter到稳定版:flutter channel stable && flutter upgrade
    2. 确保Xcode版本与当前Flutter版本兼容(可通过flutter doctor检查版本匹配情况)

原因说明

这个错误主要是前一次构建中断后,Flutter生成的临时构建结果文件未被自动清理,导致后续Xcode构建时无法创建同名文件;而IDEResultKitSerializationConverter的警告多为Xcode与Flutter工具链的小版本兼容问题,清理缓存和临时文件后通常会自动消失。

内容的提问来源于stack exchange,提问作者Winston T.

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.13 19:05:05