CoreData Multiple commands produce 编译报错处理

849 阅读1分钟
error: Multiple commands produce '/Users/dingding/Library/Developer/Xcode/DerivedData/demoApp-ctrslxeijphgwleoriuxucwoxoth/Build/Intermediates.noindex/demoApp.build/Debug-iphonesimulator/demoApp.build/Objects-normal/x86_64/KUserInfo+CoreDataProperties.o':
1) Target 'demoApp' (project 'demoApp') has compile command with input '/Users/dingding/Desktop/demoApp/demoApp/Module/KCoreData/KUserInfo+CoreDataProperties.m'
2) Target 'demoApp' (project 'demoApp') has compile command with input '/Users/dingding/Library/Developer/Xcode/DerivedData/demoApp-ctrslxeijphgwleoriuxucwoxoth/Build/Intermediates.noindex/demoApp.build/Debug-iphonesimulator/demoApp.build/DerivedSources/CoreDataGenerated/KCoreData/KUserInfo+CoreDataProperties.m'

报错原因:xcode自动生成了KUserInfo+CoreDataProperties 文件和本地手动生成的 KUserInfo+CoreDataProperties文件冲突了。那为什么Xocde会自动生成呢? 上图 entityCodegen默认就是 ClassDefion,这个选项会自动生成的。选择 Manual/None 就不会自动生成了。

所以解决方案就是: ClassDefion 改为 Manual/None