CoreData:注释:无法在路径 'Users/~/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo' 加载优化模型

CoreData: annotation: Failed to load optimized model at path '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'

我已经尝试过的东西:

有人知道修复方法吗?

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