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

升级Xcode 14.3后Flutter项目打包出现PhaseScriptExecution非零退出码错误

解决Xcode14.3下Flutter iOS打包找不到DKImagePickerController.framework的问题

问题核心

打包时Embed Pods Frameworks脚本执行rsync命令时,无法找到DKImagePickerController.framework文件,导致脚本执行失败。

解决步骤

1. 彻底清理并重新安装依赖

  • 在Flutter项目根目录执行:
    flutter clean
    cd ios
    rm -rf Pods Podfile.lock
    pod install
    

2. 确保依赖版本兼容Xcode14.3

  • 检查引入DKImagePickerController的Flutter插件版本,升级至最新兼容版本
  • 若直接在Podfile中声明了该库,将其版本更新为支持Xcode14.3的最新版,再重新执行pod install

3. 修正Xcode Build配置

  • 打开ios/Runner.xcworkspace,选中Runner目标
  • 进入Build Settings,搜索Build Locations:
    • 将Per-configuration Build Products Path设置为 $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
    • 将Uninstalled Products Path设置为 $(BUILD_DIR)/UninstalledProducts/$(PLATFORM_NAME)

4. 通过Pod post_install脚本修正路径

若上述方法无效,在ios/Podfile末尾添加以下配置,强制指定框架的构建路径:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    if target.name == 'DKImagePickerController'
      target.build_configurations.each do |config|
        config.build_settings['BUILD_DIR'] = "$(SRCROOT)/../build/ios"
      end
    end
  end
end

添加后重新执行pod install

5. 清理Xcode DerivedData

  • 打开Xcode,点击顶部菜单栏Xcode -> Settings -> Locations
  • 点击DerivedData旁的箭头打开目录,删除当前项目对应的DerivedData文件夹,或直接清空整个目录

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.20 14:12:51