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

使用Xcode14+Google ML Kit构建iOS应用遇文件缺失错误求助

解决Google ML Kit示例工程构建文件缺失错误

可行的排查与修复步骤:

  • 彻底清理并重建依赖与构建缓存

    1. 关闭Xcode,执行命令删除全局DerivedData缓存:rm -rf ~/Library/Developer/Xcode/DerivedData
    2. 回到工程根目录,执行pod deintegrate && pod install重新集成CocoaPods依赖
    3. 重新打开VisionWithRoomExample.xcworkspace,按下Cmd+Shift+K清理构建文件夹,再尝试重新构建
  • 检查Target依赖关系与构建顺序
    进入工程Target设置的Build Phases面板:

    • 确认VisionWithRoomExampleObjC Target已添加到主Target的Target Dependencies列表中,确保它优先于主Target完成构建
    • 检查主Target是否有引用该ObjC Target产物的脚本或构建步骤,确认路径配置无误
  • 验证构建路径配置

    1. 打开Xcode偏好设置(Cmd+,)> Locations,确认Derived Data设置为Custom且路径指向正确的工程目录
    2. 在工程Build Settings中搜索Per-configuration Build Products Path,确保Debug/Release配置的路径为相对工作区的格式,比如$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
  • 检查自定义脚本的输出配置
    若工程包含生成目标文件的自定义脚本:

    • 进入主Target的Build Phases > Run Script步骤,确认脚本逻辑能正常生成VisionWithRoomExampleObjC文件
    • 在脚本的Output Files栏添加该文件的完整路径,让Xcode能够追踪到文件的生成状态

错误原文:
error build: Build input file cannot be found: '/Users/Guilherme/Documents/VisionWithRoom/DerivedData/VisionWithRoomExample/Build/Products/Debug-iphoneos/VisionWithRoomExampleObjC.app/VisionWithRoomExampleObjC'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.12 21:15:36