【发布时间】:2018-07-03 23:16:10
【问题描述】:
在我的 iOS 应用程序中打开加载地图视图时出现错误。地图视图可以正常加载并显示在屏幕上,但是它没有加载到我在初始化地图视图时设置的位置。
这是我用来实现地图视图的代码:
@IBOUTLET weak var mapView: UIView!
override viewDidLoad() {
let camera = GMSCameraPosition.camera(withLatitude: lat!, longitude: long!, zoom: 10)
mapView = GMSMapView.map(withFrame: mapView.frame, camera: camera)
}
每当应用加载带有地图视图的视图控制器时,就会出现这种情况:
CoreData: annotation: Failed to load optimized model at path '/Users/johnrendleman/Library/Developer/CoreSimulator/Devices/D9D3A943-E0B4-4DE2-8120-A6E9AE3B3F88/data/Containers/Bundle/Application/934980AB-F8E4-4214-8435-9E684AF58C87/ChapelHillTransit.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
CoreData: annotation: Failed to load optimized model at path '/Users/johnrendleman/Library/Developer/CoreSimulator/Devices/D9D3A943-E0B4-4DE2-8120-A6E9AE3B3F88/data/Containers/Bundle/Application/934980AB-F8E4-4214-8435-9E684AF58C87/ChapelHillTransit.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
CoreData: annotation: Failed to load optimized model at path '/Users/johnrendleman/Library/Developer/CoreSimulator/Devices/D9D3A943-E0B4-4DE2-8120-A6E9AE3B3F88/data/Containers/Bundle/Application/934980AB-F8E4-4214-8435-9E684AF58C87/ChapelHillTransit.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
我已经尝试过的事情:
- 干净的构建。
- 更新 pod 存储库和 pod(适用于 iOS 2.7.3 的 Google Maps & Places API
- 更新 XCode (9.4.1)
- 使用适当的捆绑标识符限制重新生成 API 密钥
- 确保我的 API 在 Google Developer Console 上启用
有人知道修复方法吗?
【问题讨论】:
标签: ios swift xcode google-maps-sdk-ios