具體報錯如下:
- Target 'XX' (project 'XX') has copy command from '/XX/Info.plist' to 'XX/Info.plist'
- 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':
方法同上词疼,刪除對應(yīng)的Contents.json
方法二:
File -> Project/Workspace settings.
-> Build System 選擇 Legacy Build System
至于會出現(xiàn)以上錯誤的原因佑菩,Xcode10使用了一個的新創(chuàng)建系統(tǒng)震叮,比之前的提供更好的可靠性與創(chuàng)建性能肝断,而且可以獲取項目配置問題(默認(rèn)設(shè)置新創(chuàng)建系統(tǒng))
在蘋果文檔中,提到Xcode10中的關(guān)于舊項目New Build System更改適配,而New Build System會對構(gòu)建中的元素循環(huán)進(jìn)行嚴(yán)格的檢查,避免不必要的重建,這個也是錯誤出現(xiàn)的原因旬昭。
文檔內(nèi)容如下:
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.