❌error:Multiple commands produce '/Users/imac/Library/Developer/Xcode/DerivedData/IgnoreProject-gsfhgefvmptoimgvqgxewaenboit/Build/Products/Debug-iphoneos/IgnoreProject.app/Info.plist'
note: Target 'IgnoreProject' (project 'IgnoreProject') has copy command from '/Users/imac/Documents/IgnoreProject/IgnoreProject/Info.plist' to '/Users/imac/Library/Developer/Xcode/DerivedData/IgnoreProject-gsfhgefvmptoimgvqgxewaenboit/Build/Products/Debug-iphoneos/IgnoreProject.app/Info.plist'
note: Target 'IgnoreProject' (project 'IgnoreProject') has process command with output '/Users/imac/Library/Developer/Xcode/DerivedData/IgnoreProject-gsfhgefvmptoimgvqgxewaenboit/Build/Products/Debug-iphoneos/IgnoreProject.app/Info.plist'
你可能会这么做:
1.删除.app
文件


2.删除
/Users/imac/Library/Developer/Xcode/DerivedData
目录下的IgnoreProject-gsfhgefvmptoimgvqgxewaenboit
文件夹,也就是经常说的清理DerivedData
数据,此做法可以说是做法1
的升级版,甚至有些不放心的,去清理了废纸篓。注:这里的IgnoreProject
就是项目名称


3.删除原
plist
文件及路径,重新生成(复制)文件,重新添加文件并配置路径


最后发现忙活半天❌并没有像期望的那样消失不见,编辑器依旧提示Build Failed
编译报错,而且报错内容也没变,所以我们再回归到最初的问题进行分析。
首先可以确定这并不是Info.plist
文件路径的问题,接下来我们看看error
的描述Multiple commands produce
,很显然Multiple
才是重点,再看看note
中的描述,不难发现copy
字眼,所以可以初步判定应该是有重复或者重名的东西存在,导致Building targets in dependency order
编译不过发生错误,然后我们就可以尝试这样做:
方法一:选中项目TARGETS
,选择Build Phases
,展开Copy Bundle Resources
下拉列表,选中列表中Info.plist
文件点击-
号键删除文件配置项。

方法二:选中
Info.plist
文件项,取消Target MemberShip
选中。

那么问题来了,很多项目都是多
TARGETS
开发,需要自定义配置,而且大部分情况下单TARGETS
模式下基本也都会另起炉灶自定义配置,所以方法一
、方法二
满足不了自定义的需求,那么请尝试下面的方法三
方法三:重命名
Info.plist
文件或者重新自定义生成Info.plist
文件,添加文件到项目中,选中项目TARGETS
,选择Build Seetings
,搜索关键字Info.plist
或者滚动浏览找到Packaging
栏,正确配置Info.plist File
文件路径项。

方法三中多
TARGETS
添加多个自定义或副本Info.plist
文件,但是Info.plist File
文件配置路径一定要正确与文件路径一致,否则就会出现下面的情况

网友评论