21

Failed to load OMO warning (potential crash):

Project with xcode 9 following warning is observed in the console during debug/release builds (iOS 11 GM/beta & iOS 10):

CoreData: annotation:  Failed to load optimized model at path "/Users/xyz.abc/Library/Developer/CoreSimulator/Devices/A-GUID/data/Containers/Bundle/Application/B-GUID/app-name.app/Frameworks/framework-name/mystorename.momd/mystorename 6.omo"

Any custom framework (e.g. GoogleMaps, etc) that uses CD also results in this warning and potential crashes.

Update: Using Xcode11, noticed similar issue with DTDeviceKitBase.framework:

CoreData: annotation: Failed to load optimized model at path '/Applications/Xcode11.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/CrashDatabaseModel.momd/CrashDatabaseModel-5.0.1.omo'

Note:

  • Also noticed this with modal used in app and other framework. For app, clean build results in this error. Path shown in warning points to model used with app and not a framework.
  • Compilation with previous Xcode do work fine and no warning is noticed.

Tried following:

  1. complete clean build
  2. ensured omo exists in datamodel v6, ManagedObjectModel & PersistentStoreCoordinator are non-nil. All functionality works as expected.
  3. add newer version of datamodel v7, ensured omo v7 exists -- clean builds & device deployment
  4. added schema again

Please add suggestions. What are the potential implications of this warning?

Related:

  1. https://openradar.appspot.com/33212613
  2. https://openradar.appspot.com/33573724
  3. https://openradar.appspot.com/33773917
  4. https://issuetracker.google.com/issues/35827124
  5. https://issuetracker.google.com/issues/35827113

Similar issues with old Xcode 6/iOS 9 and Xcode 7/iOS 9

  1. Core Data - Failed to load optimized model at path
  2. CoreData: Failed to load optimized model at path
  3. Google Maps SDK for iOS Runtime warning - Core Date Failed to Load Optimised Path
Community
  • 1
  • 1
lal
  • 7,410
  • 7
  • 34
  • 45
  • Hey, did you managed to fix it? – DaNLtR Sep 22 '17 at 18:37
  • 1
    @DaNLtR, Not yet. I haven't observed crashes yet, planning to get back to it in a few days. – lal Sep 23 '17 at 22:18
  • 1
    tnx:) googleMaps SDk crashes my ios 11 app with no reason! – DaNLtR Sep 24 '17 at 07:01
  • I saw that warning over the weekend when doing some work on my app to update it (the current version works on iOS 11, but I wanted to start removing some deprecation warnings as the app was originally written for iOS 5). When I went to use the app today, it crashed when trying to open one of my core data files. I had a backup of the core data file (the app makes backups) and I was able to open it. Hopefully Apple can fix this soon. Glad I didn't make an update to the App Store! – Dave Reed Sep 25 '17 at 15:04
  • Hi @DaveReed, Do you know (any link to info please) that's causing the apps to crash that were released with XCode 9 GM? – lal Sep 25 '17 at 16:45
  • No, I don't have any more information than what's here. I saw this failed to load optimized model at path when compiling my app so googled the phrase and found this question. – Dave Reed Sep 29 '17 at 23:49
  • @lal have you found any fix? – Alex Ioja-Yang Oct 24 '17 at 09:00
  • Haven't found a fix yet. Trying the new Xcode beta. – lal Oct 25 '17 at 12:57
  • I am not getting callback (completion handler) from Google SDK when I call reverseGEO , is it related to this warning. – AppleBee Dec 11 '17 at 11:28
  • 1
    Check out this [answer](https://stackoverflow.com/a/53973476/82813) to the linked question. – manikal Jan 11 '19 at 08:55

4 Answers4

11

The only way now to handle it (ios 11 = crash, not only warning) is to downgrade your sdk!!

Within your Podfile modify the following lines:

pod 'GoogleMaps', '2.2'
pod 'GooglePlaces', '2.2'

After doing so, run pod update so the library will get updated.
any version above it will crash.

Update: try creating new target and run updated pod - worked for us

DaNLtR
  • 561
  • 5
  • 21
  • 1
    Also getting this on other frameworks (not GoogleMap) and with clean built app code. The logged warning has path that points to model used with app. – lal Oct 25 '17 at 12:56
  • Also happens with xcode11 for frameworks: /Applications/Xcode11.app/Contents/SharedFrameworks/DTDeviceKitBase.framework – lal Oct 09 '19 at 00:19
1

The GoogleMaps 2.5.0 is out which is supposed to solve the issue.

Here is the issue tracker: Crashes on iOS 11

just update your Podfile

pod 'GoogleMaps'
pod 'GooglePlaces'

And pod update

I was getting these warnings on a simulator, after reverting my 'GoogleMaps' pod to 2.2 the API didn't show the map anymore. I updated to 2.5 which just got releases, the map works now but I still get these logs.

Also try a clean build! My app suddenly started crashing whenever I was opening a controller with GoogleMaps imported in it and everything was absolutely fine so I spent hours and finally just did a clean build and the issue was resolved!

command + shift + B
Ramin
  • 335
  • 4
  • 14
  • solved the issue for me but I still get the warnings. Try a clean build: command + shift + B – Ramin Dec 05 '17 at 17:37
  • I having a similar issue, but not using pod 'Google....'. I am only using these pods 'Parse', 'Parse/UI' and 'SwiftSoup'. – Michel Feb 01 '20 at 10:54
1

Upgrading Xcode to Version 9.1 beta (9B46) doesn't output this warning in the console. Tried following to reproduce console message:

  • Clean pods entirely, and rebuilt project.
  • Complete Xcode clean including derived data, simulator cleanup.
  • Device deployment, no crash observed.
lal
  • 7,410
  • 7
  • 34
  • 45
0

Performing a Clean Build Folder with Product->Clean Build Folder solved the issue for me in Xcode 11.5. I wasnt using anything google related in my app and this problem just suddenly appeared. Hopefully this helps someone.

Cosworth66
  • 597
  • 5
  • 14