【问题标题】:CoreData: annotation: Failed to load optimized model at path 'Users/~/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'CoreData:注释:无法在路径“Users/~/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo”加载优化模型
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2018-04-04
      • 2019-11-16
      • 2015-12-19
      • 2018-02-28
      • 1970-01-01
      • 2018-04-03
      • 2019-03-01
      • 1970-01-01
      相关资源
      最近更新 更多