Xcode运行旧项目报错Multiple commands produce'XXX'/info.plist

具体报错如下:

  1. Target 'XX' (project 'XX') has copy command from '/XX/Info.plist' to 'XX/Info.plist'
  2. Target 'XX (project 'XX') has process command with output '/XX/Info.plist'

解决办法一:
target——buildphases——Copy Bundle Resources,删除plist.info

其他:
Multiple commands produce 'XX/Contents.json':
方法同上,删除对应的Contents.json

方法二:
File -> Project/Workspace settings.
-> Build System 选择 Legacy Build System

Xcode运行旧项目报错Multiple commands produce'XXX'/info.plist_第1张图片
图片.png

Xcode运行旧项目报错Multiple commands produce'XXX'/info.plist_第2张图片
图片.png
Xcode运行旧项目报错Multiple commands produce'XXX'/info.plist_第3张图片
图片.png

至于会出现以上错误的原因,Xcode10使用了一个的新创建系统,比之前的提供更好的可靠性与创建性能,而且可以获取项目配置问题(默认设置新创建系统)

在苹果文档中,提到Xcode10中的关于旧项目New Build System更改适配,而New Build System会对构建中的元素循环进行严格的检查,避免不必要的重建,这个也是错误出现的原因。

文档内容如下:

The new build system has stricter checks for cycles between elements in the build in order to prevent unnecessary rebuilds.
It is an error for any individual file in the build to be produced by more than one build command. For example, if two targets each declare the same output file from a shell script phase, factor out the declaration of the output file into a single target.

你可能感兴趣的:(Xcode运行旧项目报错Multiple commands produce'XXX'/info.plist)