ios - 核心数据 : annotation: Failed to load optimized model at path 'Users/~/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'

标签 ios swift xcode google-maps-sdk-ios

在我的 iOS 应用程序中打开加载 map View 时出现错误。 map View 加载正常并出现在屏幕上,但是它没有加载到我初始化 map View 时设置的位置。

这是我用来实现 map View 的代码:

@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)
}

每当应用程序用 map View 加载 View Controller 时,它就会出现:

CoreData:注释:无法在路径 '/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:注释:无法在路径 '/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:注释:无法在路径 '/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(Google Maps & Places API for iOS 2.7.3
  • 更新 XCode (9.4.1)
  • 使用适当的包标识符限制重新生成 API key
  • 确保我的 API 在 Google Developer Console 上启用

有人知道修复方法吗?

最佳答案

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

关于ios - 核心数据 : annotation: Failed to load optimized model at path 'Users/~/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51163911/

相关文章:

ios - 如何在纵向模式下锁定 viewController

ios - 使用 unwind segue 获取要显示的签名(YPDrawSignatureView)

ios - 将 UILabel 位置更改为 CGPath 的 strokeEnd

swift 3 和火力地堡 : Retrieve auto id value from snapshot

ios - libOmniture AppMeasurement-iPhoneSimulator.a 没有链接到 iOS 4 项目

ios - NSString 操作。仅删除日期

android - 无法在底部工作表上显示日期选择器

swift - 动画不行?

c++ - 无法从终端编译c++文件

ios - 音频结束时更改按钮 Xcode