4

My xcdatamodel file in Xcode seems to be behaving weirdly.

When I build my project for the first time it gives an error

"Unable to write VersionInfo.plist for the versioned model at <Path>" 

and

"Compilation failed for data model at path <Path>"

But when I run it again, it runs without an error. Then after some time the error pops up again and again vanishes when I build again. Sometimes I get a different error message which says

Unable to remove existing model

Any Ideas ??

Hemang
  • 26,840
  • 19
  • 119
  • 186
evanescent
  • 1,373
  • 13
  • 20
  • possible duplicate of [Could not create bundle folder for versioned model?](http://stackoverflow.com/questions/14230297/could-not-create-bundle-folder-for-versioned-model) – JasonMArcher Jun 06 '14 at 23:15
  • @evanescent Were you able to fix this issue? I am getting the exact same error-message in XCode 7.2.1 – TMob Mar 23 '16 at 07:20

2 Answers2

2

I was getting this same error, then eventually also got the error mentioned in this other question/answer. After following the suggestion in this answer, the error seems to have gone away:

Solution 1:

Delete the following directory:

/Users/john/Library/Developer/Xcode/DerivedData/name-of-app-gfofxrkhgcfgcfecjrnbbgyowlnf

I later got the same error where this first solution didn't work. This time the following solution worked instead:

Solution 2:

Recursively set the permissions to 777 for this directory:

chmod -R 777 /Users/john/Library/Developer/Xcode/DerivedData/name-of-app-gfofxrkhgcfgcfecjrnbbgyowlnf
Community
  • 1
  • 1
John Langford
  • 1,272
  • 2
  • 12
  • 15
0

1. Remove derived data: Windows > Projects > Select your project > Derived Data > Delete

2. Clean your project.

It should work. If still not working,

3. Run the project continuously (This actually had worked for me..)

Hope it works !!!

NSPratik
  • 4,714
  • 7
  • 51
  • 81