Core Data project build fails exit code 1

I've been banging my head against the wall last day. Ive finished one project all went OK. I started a new project and got following when building :-

Using xcode 8.1

<unknown>:0: error: filename "Album+CoreDataClass.swift" used twice: '/Users/micksmith/Programming/SwiftProjects/SnapHappy/Album+CoreDataClass.swift' and '/Users/micksmith/Library/Developer/Xcode/DerivedData/SnapHappy-abvubvejhfvtvwambefooawkvkrb/Build/Intermediates/SnapHappy.build/Debug-iphonesimulator/SnapHappy.build/DerivedSources/CoreDataGenerated/SnapHappy/Album+CoreDataClass.swift'

<unknown>:0: note: filenames are used to distinguish private declarations with the same name

<unknown>:0: error: filename "Album+CoreDataProperties.swift" used twice: '/Users/micksmith/Programming/SwiftProjects/SnapHappy/Album+CoreDataProperties.swift' and '/Users/micksmith/Library/Developer/Xcode/DerivedData/SnapHappy-abvubvejhfvtvwambefooawkvkrb/Build/Intermediates/SnapHappy.build/Debug-iphonesimulator/SnapHappy.build/DerivedSources/CoreDataGenerated/SnapHappy/Album+CoreDataProperties.swift'

<unknown>:0: note: filenames are used to distinguish private declarations with the same name

<unknown>:0: error: filename "Photo+CoreDataClass.swift" used twice: '/Users/micksmith/Programming/SwiftProjects/SnapHappy/Photo+CoreDataClass.swift' and '/Users/micksmith/Library/Developer/Xcode/DerivedData/SnapHappy-abvubvejhfvtvwambefooawkvkrb/Build/Intermediates/SnapHappy.build/Debug-iphonesimulator/SnapHappy.build/DerivedSources/CoreDataGenerated/SnapHappy/Photo+CoreDataClass.swift'

<unknown>:0: note: filenames are used to distinguish private declarations with the same name

<unknown>:0: error: filename "Photo+CoreDataProperties.swift" used twice: '/Users/micksmith/Programming/SwiftProjects/SnapHappy/Photo+CoreDataProperties.swift' and '/Users/micksmith/Library/Developer/Xcode/DerivedData/SnapHappy-abvubvejhfvtvwambefooawkvkrb/Build/Intermediates/SnapHappy.build/Debug-iphonesimulator/SnapHappy.build/DerivedSources/CoreDataGenerated/SnapHappy/Photo+CoreDataProperties.swift'

<unknown>: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


I've checked online and tried the following :-

deleted derived data

cleaned build folder

deleted Xcode and reinstalled

etc

I've tried everything I can find online and still can't build my project.

Would appreciateany help at all to solve the problem as I can do nothing until it's solved.

Accepted Answer

I've solved the problem at last.

After comparing my project xcdatamodeld with a OK project I found some differences.

In the Entity Class I've changed Codegen from Class Definition to Manual/None and Module to Current Product Module and it now compiles with no errors.


Just to update I had problems further on in the development and had to change the codegen again and delete Current Product Module.

So now its just Manual/None set.

Core Data project build fails exit code 1
 
 
Q