Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compilation failed for data model at path

I'm trying to release an app to the app store tonight. I've been developing the Xcode 6 - Beta 2 for the past few months (Objective-C only) and didn't know you were not allowed to submit via Xcode Beta. So, I opened the project in plain Xcode and upon an attempt to re-archive the project received the following error:

Compilation failed for data model at path '/Users/ME/Library/Developer/Xcode/DerivedData/ProjectDataFolder/Build/Products/Debug-iphoneos/Project.app/Model.momd/Model.mom'

I tried deleting the derived data, cleaning the build folder, etc etc the standard stuff. I also tried cleaning the archives folder and the simulator apps folder. Neither worked. However, reopening the app in Xcode Beta worked on the first try. Back to Xcode, same error occurred.

Any help would be greatly appreciaed.

like image 751
jtmarmon Avatar asked Aug 31 '14 05:08

jtmarmon


3 Answers

I had this problem after creating a new CoreData model version and immediately deleting it. The said version didn't appear in Xcode's Project Navigator but was causing the compilation error. I used the "Show in Finder" at one of the model versions and found the .mom file of the deleted model version. Manual deletion solved it for me.

like image 158
Christoph Avatar answered Nov 12 '22 13:11

Christoph


I have faced the same issue (Xcode version - 6.1.1). For me the following 2 steps helped:

  • I deleted extra model versions by using the "Show in Finder" option for .xcdatamodel file
  • I removed a reference to an .xcdatamodel file and added it again
like image 37
Ivan Kravchenko Avatar answered Nov 12 '22 13:11

Ivan Kravchenko


I had the same error, in my instance this was caused by us accidentally having the xcdatamodelid file referenced twice in Targets->Build Phases->Compile sources Simply deleting one of the duplicate entries fixed it.

This may not have been what caused your issue, but it had me stumped for a couple of days so worth checking if anyone else gets stuck on the same problem again.

like image 4
John Sibly Avatar answered Nov 12 '22 13:11

John Sibly