Failed to load optimized model - GoogleMaps SDK IOS
Asked Answered
B

5

30

I am getting this error after installing Google Maps SDK from CocoaPods.

CoreData: annotation:  Failed to load optimized model at path '/Users/nabeel/Library/Developer/CoreSimulator/Devices/96078737-8063-4BC1-97DB-7FECEC6835D9/data/Containers/Bundle/Application/972CD686-82DD-4357-9CDD-65A735D82190/My-APP-Beta.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileVersionID.omo'
CoreData: annotation:  Failed to load optimized model at path '/Users/nabeel/Library/Developer/CoreSimulator/Devices/96078737-8063-4BC1-97DB-7FECEC6835D9/data/Containers/Bundle/Application/972CD686-82DD-4357-9CDD-65A735D82190/My-APP-Beta.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileVersionID.omo'
CoreData: annotation:  Failed to load optimized model at path '/Users/nabeel/Library/Developer/CoreSimulator/Devices/96078737-8063-4BC1-97DB-7FECEC6835D9/data/Containers/Bundle/Application/972CD686-82DD-4357-9CDD-65A735D82190/My-APP-Beta.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileVersionID.omo'

I have tried pod update and pod install again but same issue.

Bitterroot answered 11/11, 2017 at 10:14 Comment(3)
I am getting same error tooFingered
i have the same issueKnorr
Go to console.developers.google.com/apis/api/… , select Library and enable Google Maps SDK for iOSSingletree
H
44

If you have already double-checked the basic setup for the "google maps ios-sdk" with an APIkey for your app's bundle identifier here and still have the same problem then probably you have not enabled the google maps API. Go to your app-project's dashboard on https://console.developers.google.com and click the "ENABLE APIS AND SERVICES". There, under the MAPS section select "the Google maps sdk for ios" and enable it.

Harmonics answered 15/11, 2017 at 13:11 Comment(5)
This worked for me. I was using Api key without iOS App restriction and Google map ios sdk enabled. So I created a new key with iOS app restriction and provided the bundle id and also enabled Google map ios sdk.Bitterroot
But Run into another issue the map loads in parent view but does not loads in any subview.Bitterroot
Oh that is another question which you should create and show some code in order to be answered. Maybe you can share a link here for it when you do that?Harmonics
Important note! : If the map appears as normal but the message "CoreData: annotation: Failed to load optimized model at path ... /GMSCacheStorage.momd/StorageWithTileVersionID.omo' " is still showing then this is an issue from the google maps ios sdk.. Here is the issue-tracker for it: issuetracker.google.com/issues/64504919Harmonics
I've done all that and the map still does not load. It does not work for meKnorr
L
8
  1. Selecte [APP-NAME].app and show it in finder and show package contents.
  2. You will see GoogleMaps.bundle, right click and show it's package contents.
  3. Enter GMSCacheStorage.momd folder.
  4. Delete StorageWithTileProto.omo.

After that those errors disappeared.

Lubalubba answered 30/3, 2018 at 8:20 Comment(1)
I tried with delete StorageWithTileProto.omo but it's generating agin when i am running my app agin. And error log showing again.Hectorhecuba
S
6

Expand GoogleMaps.bundle from Project Navigator(in Xcode) then expand GMSCacheStorage.momd folder. Now delete StorageWithTileProto.omo file from this folder and run project again.

Sewerage answered 8/2, 2018 at 11:32 Comment(1)
You mean this solves the issues in the simulator and in production we don't need that? I mean this file would be generated again in production? Sorry a beginner here.Minton
B
3

I just run into another issue with same warnings. The map was working fine but there were few warnings in the console. I googled around and found this solution.

  1. Go to products group in your project navigator and select your [APP-NAME].app and then show in finder and choose show package contents

  2. Now you will see your [APP-NAME].momd folder. Open it there you will see your [APP-NAME].omo

  3. Move [APP-NAME].omo to Trash and run the project again

  4. Log message should not be displaying in console now.

Note: Don't delete any .mom files

Bitterroot answered 1/1, 2018 at 9:38 Comment(1)
I can't find [APP-NAME].momd folderKnorr
Y
2

Take a look at this link about the errors which sometimes result in crashes in GoogleMaps SKD 2.4 and 2.5 including in my case (2.5):

https://issuetracker.google.com/issues/64504919

Also try:

Command + Shift + B

I know, it might sound silly but I spent HOURS and this was what finally solved my issue! A CLEAN BUILD After all!

Some people experiencing the same issue suggested downgrading the SDK to 2.3, I did that and results were the same and also my code was crashing all the time so I had to update back to 2.5

Yazbak answered 4/12, 2017 at 3:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.