【发布时间】: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