I ran into the same problem after some heavy editing of my DataModel. All my entities use Codegen Category/Extension and subclasses, and suddenly I got this cryptic error:
error: Multiple commands produce '/Library/Developer/Xcode/DerivedData/MyApp-futvjnnhiceyibabpbzhxltebhoq/Build/Intermediates.noindex/MyApp.build/Debug/MyApp.build/DerivedSources/CoreDataGenerated/MyApp/MyEntity+CoreDataProperties.m':
- Target 'MyApp' (project 'MyApp'): DataModelCodegen /Users/elisevanlooij/Documents/Project
MyApp/MyApp/MyApp/MyApp.xcdatamodeld
- Target 'MyApp' (project 'MyApp'): DataModelCodegen /Users/elisevanlooij/Documents/Project MyApp/MyApp/MyApp/MyApp.xcdatamodeld
After two days I found the problem: the Entity Name and the Entity Class Name no longer matched in the DataModel, forcing Codegen to generate two extensions for one entity.Once I fixed that, threw away the app's Intermediates folder in ~/Library/Developer/Xcode/DerivedData and did a Product > Clean Build Folder, everything compiled beautifully again.
The error message is technically correct, but massively unhelpful. The DataModel interface should flag this as soon as it happens, but one can only dream of a day when Apple pays proper attention to Core Data.