【问题标题】:Issue Google maps API on iOS 11 with Xcode 9使用 Xcode 9 在 iOS 11 上发布 Google 地图 API
【发布时间】:2018-03-19 22:35:55
【问题描述】:

我正在尝试在我的应用程序的视图中设置地图,但遇到了这个问题:

CoreData:注释:无法在路径 '/var/containers/Bundle/Application/35C61A40-48B9-40E0-A6F9-AB7492A15009/simply-convertor.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage 加载优化模型。呸呸呸 CoreData:注释:无法在路径“/var/containers/Bundle/Application/35C61A40-48B9-40E0-A6F9-AB7492A15009/simply-convertor.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo”加载优化模型 CoreData:注释:无法在路径'/var/containers/Bundle/Application/35C61A40-48B9-40E0-A6F9-AB7492A15009/simply-convertor.app/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'加载优化模型

我向 ViewContoroller 添加了一个空视图,并将其类型更改为 GMSMapView。 在 viewDidLoad 方法中,我从位置创建一个新地图并初始化我的主 mapView:

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
    }

有什么问题?

【问题讨论】:

  • 错误消息表明您遗漏了一些 Google 地图框架需要的文件。 Google 地图出现内部错误,因为它找不到预期存在的文件。
  • 我该如何解决?我是通过 CococaPods 安装的
  • 我不能说,这就是为什么我留下评论而不是答案。该错误消息强烈表明这不是 Core Data 问题,而是 Core Data 遇到了问题,因为缺少关键文件。
  • 这似乎是谷歌地图 SDK 的问题,该问题已报告给谷歌,这里是链接:issuetracker.google.com/issues/64504919。目前还没有解决,希望早日解决

标签: swift xcode google-maps core-data cocoapods


【解决方案1】:

我发现我的问题.. 看来我误解了 GMSMapView 的初始化并且没有正确初始化它..

从其他帖子中,我提到的 CoreData 错误是 Google API 的问题,它不会影响应用程序。

【讨论】:

  • 我也有同样的警告。你能分享你的解决方案吗?
  • 我也遇到了同样的问题。你能分享你的解决方案吗?谢谢
  • 我也有同样的警告。你能分享你的解决方案吗?
  • 我也有同样的警告。你能分享你的解决方案吗?
  • 我也有同样的警告。你能分享你的解决方案吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-03-04
  • 2018-02-22
  • 1970-01-01
  • 1970-01-01
  • 2018-01-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多