【问题标题】:GMSGeocoder.reverseGeocodeCoordinate throws fatal errorGMSGeocoder.reverseGeocodeCoordinate 抛出致命错误
【发布时间】:2017-04-15 07:28:07
【问题描述】:

当我尝试反转 somewhere in the South Atlantic Ocean 的坐标时,

let geocoder = GMSGeocoder.init()
let coordinate = CLLocationCoordinate2D.init(
    latitude: -33.724339999999998, 
    longitude: -15.996094000000001)

geocoder.reverseGeocodeCoordinate(coordinate) { (response, error) in 
  print(response)
})

致命错误:在展开可选值时意外发现 nil

是的,我不希望得到响应,但它不应该因致命错误而失败,对吗?

这是GMSGeocoder 的正常行为吗?

【问题讨论】:

    标签: google-maps google-maps-sdk-ios google-geocoder reversegeocodelocation


    【解决方案1】:

    所以我在使用谷歌地图的反向地理编码时也遇到了这种奇怪的崩溃,因为您既没有选择正确的答案也没有发布自己的解决方案。我检查了我的应用程序的生产版本(来自 App Store)工作正常。我确实尝试隐藏我的更改只是为了检查我做了什么导致这次崩溃的废话。

    日志还声明如下:

    Google Maps SDK for iOS 要求 GoogleMaps.bundle 成为您的目标的一部分

    现在解决方案,我也在这里发布:https://stackoverflow.com/a/45607775/3231194

    基本上只是尝试更新您的 pod 并清理项目和构建,然后您就可以开始了。

    【讨论】:

      【解决方案2】:
      geocoder.reverseGeocodeCoordinate(coordinate) {(response, error) in 
      
          if((response?) != nil){
              print(response)
          }
      
      })
      

      【讨论】:

      • 嗨,你能解释一下你的代码吗?仅代码的答案可能会被删除。
      猜你喜欢
      • 1970-01-01
      • 2015-01-18
      • 1970-01-01
      • 1970-01-01
      • 2010-12-06
      • 2017-10-27
      • 2015-02-21
      • 1970-01-01
      • 2015-11-06
      相关资源
      最近更新 更多