首页 > 解决方案 > CoreData:注释:无法在路径“Users/~/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo”加载优化模型

问题描述

在我的 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'

我已经尝试过的事情:

有人知道修复吗?

标签: iosswiftxcodegoogle-maps-sdk-ios

解决方案


我刚刚花了 5 个小时来解决同样的问题。有时地图会显示,有时则不会。最后,我发现我的钥匙有问题。我不小心删除了它对 iOS 的权限。一些模拟器正在显示地图,因为它们缓存了密钥。还有一些人正在显示“StorageWithTileProto”错误,因为他们使用旧密钥缓存了切片,但没有授权显示它。我建议使用“StorageWithTileProto”的任何人使用新的不受限制的密钥对其进行测试,并在测试之前从设备/模拟器中完全删除该应用程序。这也可能解决您的问题。


推荐阅读