Google Maps API issue in iOS 11 with Xcode 9

I am trying to install a map in a view in my application, and I had this problem:

CoreData: annotation: Failed to load the optimized model under '/var/containers/Bundle/Application/35C61A40-48B9-40E0-A6F9-AB7492A15009/simply-convertor.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage. Omo "CoreData: annotation: Failed to load optimized model on path '/var/containers/Bundle/Application/35C61A40-48B9-40E0-A6F9-AB7492A15009/simply-convertor.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.om 'CoreData: annotation: Failed to load the optimized model along the path' /var/containers/Bundle/Application/35C61A40-48B9-40E0-A6F9-AB7492A15009/simply-convertor.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo

I add an empty view to my ViewContoroller and change it to GMSMapView. And in the viewDidLoad method, I create a new map from the location and initialize my main mapView file:

override func viewDidLoad() {
        super.viewDidLoad()
        placesClient = GMSPlacesClient.shared()
        locationManager.delegate = self
        locationManager.desiredAccuracy = kCLLocationAccuracyBest
        locationManager.requestWhenInUseAuthorization()
        locationManager.startMonitoringSignificantLocationChanges()

        locationAuthStatus()
        print(location.coordinate.latitude, location.coordinate.longitude)
        let camera = GMSCameraPosition.camera(withLatitude: 31.9650070083707, longitude: 34.7899029677496, zoom: 6.0)
        let map = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
        self.mapView = map

        // Creates a marker in the center of the map.
        let marker = GMSMarker()
        marker.position = CLLocationCoordinate2D(latitude: 31.9650070083707, longitude: 34.7899029677496)
        marker.title = "Home"
        marker.snippet = "Home"
        marker.map = mapView
    }

what is the problem?

+6
source share
1 answer

I find my problem. It seems that I misunderstood the initial GMSMapView entry and did not initialize it correctly.

From another post, the CoreData error that I mention is a Google API problem and this does not affect the application.

+2
source

All Articles