Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load optimized model at path #121

Open
fieldly opened this issue Oct 26, 2015 · 4 comments
Open

Failed to load optimized model at path #121

fieldly opened this issue Oct 26, 2015 · 4 comments

Comments

@fieldly
Copy link

fieldly commented Oct 26, 2015

Hello,

I have a problem with migrations. When I add new migrations my users have to uninstall and reinstall the app in order to get it working (crashing otherwise).

I get this error:

: CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/2F958BC5-E32A-44E3-8B4A-B7A0768CA195/Apper.app/Apper.momd/0001 initial.omo'

Also got the error:

Terminating app due to uncaught exception 'RuntimeError', reason: 'app_delegate.rb:132:in `create_local_store': Can't find or automatically infer mapping model for migration (RuntimeError)

What is this error?

@markrickert
Copy link
Member

Hey @fieldly Can you post samples of your db schema files?

One thing to note is that when you create a new schema, it's not a diff, it's a replication with additions or deletions.

  1. Copy the ENTIRE file
  2. Rename the file so that it's sequential (001_schema.rb, 002_schema_added_something.rb, etc.)
  3. Change the schema definition at the top of the NEW file to match the file name.
  4. Make additions or deletions to your schema in the new file.
  5. Save schema and compile.

As long as you're adding and deleting things, CoreData's lightweight migrations should handle everything for you automatically. Do NOT change the type of existing schema items or you'll have the same problems as you're having now with users having to delete the app and reinstall.

Hope this helps!

@MOPineyro
Copy link

Having similar issue after updating xcode and RM to 4.5.

<Warning>: CoreData: Failed to load optimized model at path '/var/mobile/Containers/Bundle/Application/D20D5112-0CD1-4D04-A332-A5692F9A74DB/Winterhawks Pick6.app/winterhawks_pick6_ios.momd/0007 modify user points type again.om

@markrickert
Copy link
Member

I'm seeing a pattern here of spaces in file names instead of underscores. I'm wondering if that's the issue here...

@MOPineyro
Copy link

Receiving the same error despite adding underscores

CoreData: Failed to load optimized model at path '/Users/mopineyro/Library/Developer/CoreSimulator/Devices/7AF779B3-E56D-4EBA-8EE4-B2A9AF1D9663/data/Containers/Bundle/Application/EA921B45-7132-41AD-BF5B-3F1C8DACE603/Winterhawks Pick6.app/winterhawks_pick6_ios.momd/0007_modify_user_points_type_again.omo'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants