I am running Xcode Version 10.1 (10B61), Mojave 10.14 (18A391)
I see this problem go away if I remove the last model added in Core Data. It seems to trigger when I add a relationship to another object. If I back out the new item, the build succeeds, but once a class is added with a to many relationship, the build fails.
I found this similar issue:
https://forums.developer.apple.com/message/292507#292507
what's similar about this issue is that the compiler is comparing the user model to the derived data model. The SO issue referenced shows an example where the user duplicated the model in their own environment.
In this link
https://forums.developer.apple.com/message/157140#157140
it mentions setting the class to "Manual/None" and this appears to work, but what is going on here? Why is this a possibility?
Error:
Multiple commands produce '//Library/Developer/Xcode/DerivedData/ProjectCoreData-ehjvvgovpitmbcegzopwciptfafr/Build/Intermediates.noindex/ProjectCoreData.build/Debug-iphonesimulator/ProjectCoreData.build/Objects-normax86_64/Contact+CoreDataClass.o':
Target 'ProjectCoreData' (project 'ProjectCoreData') has compile command for Swift source files
Target 'ProjectCoreData' (project 'ProjectCoreData') has compile command for Swift source filesfrom the logs:
:0: error: filename "Contact+CoreDataClass.swift" used twice:
'/Users//Desktop/ProjectCoreData/Contact+CoreDataClass.swift'
and
'/Users//Library/Developer/Xcode/DerivedData/ProjectCoreData-ehjvvgovpitmbcegzopwciptfafr/Build/Intermediates.noindex/ProjectCoreData.build/Debug-iphonesimulator/ProjectCoreData.build/DerivedSources/CoreDataGenerated/ProjectCoreData/Contact+CoreDataClass.swift'
:0: note: filenames are used to distinguish private declarations with the same name
:0: error: filename "Contact+CoreDataProperties.swift" used twice:
'/Users//Desktop/ProjectCoreData/Contact+CoreDataProperties.swift'
and
'/Users//Library/Developer/Xcode/DerivedData/ProjectCoreData-ehjvvgovpitmbcegzopwciptfafr/Build/Intermediates.noindex/ProjectCoreData.build/Debug-iphonesimulator/ProjectCoreData.build/DerivedSources/CoreDataGenerated/ProjectCoreData/Contact+CoreDataProperties.swift'
:0: note: filenames are used to distinguish private declarations with the same name
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1