Some weird problem is haunting me right now:
One of my apps (not yet released) crashes on startup, but only if the device has been synchronized with iTunes since the app has been installed.
The app is ad hoc distributed to some testers, one of them noticed this crash and here’s how it can be reproduced:
- Install App
- Run App, populate Core Data Store, everything works fine
- Close App, start App again, use it normally, everything works fine
- Synch Device with iTunes
- App crashes on launch immediately
From the device console I read after the crash:
The operation couldn’t be completed. (Cocoa error 134100.)
and, further down:
The model used to open the store is incompatible with the one used to create the store
What I don’t get is – the model never had an opportunity (other than the synch) to change, I haven’t touched it in months.
And what puzzles me even further is that if I install the app again (via Testflight, without removing it first in order to preserve the data), it will work again. With the same data store that earlier caused the app to crash.
So it can’t even be the data itself that gets wrecked, rather the synch does something to the model, or something.
I don’t even know where to start debugging this, since I can’t tell what exactly is happening during the iTunes synchronization.
Any hints greatly appreciated!!
If you have the app in iTunes’ app list, it is possible that iTunes might have a backup of a very old version of the same app, with an outdated data model.
Try removing your app from the app list without connecting the device.