多个命令产生

Anv*_*vil 7 xcode swift

我刚刚创建了一个新项目,并安装了一些 Pod。当我尝试构建时,出现以下两个错误:

Showing Recent Issues
Multiple commands produce '/Users/myUser/Library/Developer/Xcode/DerivedData/Demo-eobcppugxuuucmefyvotwbqadppx/Build/Intermediates.noindex/Demo.build/Debug-iphonesimulator/Demo.build/Objects-normal/arm64/AppDelegate.stringsdata':
1) Target 'Demo' (project 'Demo') has compile command for Swift source files
2) Target 'Demo' (project 'Demo') has compile command for Swift source files


Showing Recent Issues
Multiple commands produce '/Users/myUser/Library/Developer/Xcode/DerivedData/Demo-eobcppugxuuucmefyvotwbqadppx/Build/Intermediates.noindex/Demo.build/Debug-iphonesimulator/Demo.build/Objects-normal/arm64/SceneDelegate.stringsdata':
1) Target 'Demo' (project 'Demo') has compile command for Swift source files
2) Target 'Demo' (project 'Demo') has compile command for Swift source files
Run Code Online (Sandbox Code Playgroud)

Anv*_*vil 14

结果我有重复的 swift 文件targets->Build Phases删除了重复的文件,一切正常


Tai*_*rif 9

我遇到了同样的问题,但就我而言,两个swift 文件具有相同的名称。解决方案是转到Targets -> Build Phases -> Compile Sources,然后检查是否有相同名称的Swift文件,然后从其中删除任何一个。

此错误的另一个问题是在Targets -> Build Phases -> Copy Bundle Resources下,如果存在相同名称的捆绑资源,请从中删除任何一个。