iOS日常开发问题记录:That command depends on command in Target 'yoowei': script phase “[CP] Copy Pods Resourc

iOS日常开发问题记录:That command depends on command in Target 'yoowei': script phase “[CP] Copy Pods Resources”

升级Xcode 10后报错问题记录

1、升级Xcode到Version 10.0 后,运行已有项目,报如下错误:
error:Multiple commands produce ‘/Users/Leon7E/Library/Developer/Xcode/DerivedData/BAQMUIDemo-bbzaogdtmbznxnbruwzzdjrecfge/Build/Products/Debug-iphoneos/BAQMUIDemo.app’:

  1. Target ‘BAQMUIDemo’ has create directory command with output ‘/Users/Leon7E/Library/Developer/Xcode/DerivedData/BAQMUIDemo-bbzaogdtmbznxnbruwzzdjrecfge/Build/Products/Debug-iphoneos/BAQMUIDemo.app’
  2. That command depends on command in Target ‘BAQMUIDemo’: script phase “[CP] Copy Pods Resources”

原因:Xcode 10 默认使用的build system是New build system,与Xcode9不同导致。

解决:2种方法

1)第一种方法 不修改build system

根据error 日志,script phase “[CP] Copy Pods Resources”,而且与output有关,应该是使用了cocoapods导致的,尝试删除该项目target-Copy Pods Resources-Output Files,成功解决问题。选中项目target -> Build phase -> Copy Pods Resources -> Output Files -> 移除 T A R G E T B U I L D D I R / {TARGET_BUILD_DIR}/ TARGETBUILDDIR/{UNLOCALIZED_RESOURCES_FOLDER_PATH} 然后重新编译,OK 。

用这种方式紧接着会有下面的错误:

error: Cycle in dependencies between targets ‘yooweiExtension’ and ‘yoowei’; building could produce unreliable results.
Cycle path: yooweiExtension → yoowei → yooweiExtension

Cycle details:

→ Target ‘yooweiExtension’: CodeSign /Users/galahad/Library/Developer/Xcode/DerivedData/yoowei-drnrntneloepunakcqbcdycudqeh/Build/Products/Debug-iphoneos/yooweiExtension.appex

○ Target ‘yooweiExtension’: ProcessProductPackaging /Users/galahad/Library/Developer/Xcode/DerivedData/yoowei-drnrntneloepunakcqbcdycudqeh/Build/Intermediates.noindex/yoowei.build/Debug-iphoneos/yooweiExtension.build/yooweiExtension.appex.xcent

○ Target ‘yooweiExtension’ has target dependency on Target ‘yoowei’

→ Target ‘yoowei’ has target dependency on Target ‘yooweiExtension’

○ That command depends on command in Target ‘yooweiExtension’: script phase “[CP] Check Pods Manifest.lock”

对应的解决方案:选中项目target -> Build phase -> Target Dependencies 去掉相互的依赖即可

2)第二种方法 修改build system (个人感觉这种方式较好,不会每个项目搞一遍)
在Xcode菜单栏 -> File -> Workspace Setting,将build system修改为legacy build system,然后clean后编译。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值