I just created a new project, and installed some pods. When I try to build, I get these two errors:
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
3
Answers
Turns out I had duplicate swift files in
targets
->Build Phases
Deleted the ones that where duplicates, and all okI had the same problem but in my case, I have same name for two swift files. The solution for that is Go to Targets -> Build Phases -> Compile Sources, and check whether you have the same named Swift files, and remove any one from there.
Another issue of this error is under Targets -> Build Phases -> Copy Bundle Resources, if there are same named bundled resources, remove any one from that.
For me it was a view from an app extension, which was named the same as a view from my main app. Renaming the view from the extension solved the issue.