2

I installed GoogleMaps with cocoapods which installed fine, however when I run the app and try to run the snippet Google provides in their docs I get the error:

W0815 21:50:35.497383       1 commandlineflags.cc:1503] Ignoring RegisterValidateFunction() for flag pointer 0x100bc8210: no flag found at that address

CoreData: annotation:  Failed to load optimized model at path '/var/containers/Bundle/Application/7689CC83-309E-4D44-B5E0-697601B96C61/BoostRadius-iOS.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'

CoreData: annotation:  Failed to load optimized model at path '/var/containers/Bundle/Application/7689CC83-309E-4D44-B5E0-697601B96C61/BoostRadius-iOS.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'

CoreData: annotation:  Failed to load optimized model at path '/var/containers/Bundle/Application/7689CC83-309E-4D44-B5E0-697601B96C61/BoostRadius-iOS.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'

The code is straight from the docs

override func viewDidLoad() {
    super.viewDidLoad()
    view.backgroundColor = .green

    let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0)
    let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
    view = mapView

    // Creates a marker in the center of the map.
    let marker = GMSMarker()
    marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20)
    marker.title = "Sydney"
    marker.snippet = "Australia"
    marker.map = mapView
}

I am using Xcode 10 beta 5, Swift 4.2

Nader Besada
  • 1,012
  • 1
  • 5
  • 21
  • Try deleting your Derived data and then try. Also refer to this link: [https://stackoverflow.com/questions/47236769/failed-to-load-optimized-model-googlemaps-sdk-ios] – udbhateja Aug 16 '18 at 04:43
  • Unfortunately none of the solutions in the post work, and I already tried deleting derived data – Nader Besada Aug 16 '18 at 05:09
  • Have you followed the steps mentioned in the link: [link](https://stackoverflow.com/questions/47236769/failed-to-load-optimized-model-googlemaps-sdk-ios]) – udbhateja Aug 16 '18 at 05:17
  • It's just an annotation though, not errors. It's not like your app crashes or anything? Everything works fine? – Sti Aug 19 '18 at 07:27

3 Answers3

1

It looks like this bug has already been filed in Google issue tracker:

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

Unfortunately, not resolved yet. I would suggest to star this bug in issue tracker to express your interest and subscribe to further notifications from Google.

Hopefully, Google will fix it soon.

Update

Google marked the aforementioned bug as fixed with the following comment:

We believe this issue should now be solved with the new version of the SDK v3.3. Let us know otherwise.

Regarding the iPadOs issue mentioned in comment#78 could you please open a new issue with the same description to track it?

Community
  • 1
  • 1
xomena
  • 27,383
  • 5
  • 77
  • 109
0

I had this issue when first building my project with Xcode 10 with the GoogleMaps SDK version 2.7.0. I previously had no issues with Xcode 9.X. In my case, this was a relatively old project, for which the GoogleMaps SDK had been initially included by copying the bundle and framework directly into the project. The copy step was not removed when the GoogleMaps SDK was subsequently added via CocoaPods. The inclusion of the original GoogleMaps.bundle and GoogleMaps.frameworks files in the project caused the crash. When I removed the copy step for the old GoogleMaps.bundle file, the issue resolved itself. To remove the copy step:

1) Select your workspace in the Xcode file explorer.

2) Select your target in the workspace navigator.

3) Select build phases.

4) In the section "Copy Bundle Resources", make sure that there is not an entry for GoogleMaps.bundle. If there is, remove it.

5) Build and run.

If all works, you can safely remove the old GoogleMaps.bundle and GoogleMaps.framework files from your project. Be sure you are not removing the Pod version. Also you can remove references to GoogleMaps in your target's Linked Frameworks and Libraries section.

user3847320
  • 734
  • 6
  • 16
0

Make sure you had assigned the GMSMapView class to the view object. Select your view object from Storyboard and add the custom class in the identity inspector.

Cristina
  • 1
  • 1