【问题标题】:Geocoder getFromLocation failed地理编码器 getFromLocation 失败
【发布时间】:2020-09-03 17:26:24
【问题描述】:

我正在尝试从坐标中获取地标。

我为此使用geoLocator。今天早上它工作正常,但现在它抛出了平台异常。

PlatformException(IO_ERROR, A network error occurred trying to lookup the supplied coordinates (latitude: <lat>, longitude: <long>)., null)

它说是网络错误,但我的设备已连接到互联网,

首先,我认为Geolocator 包可能有问题,所以我使用了Geocoding 包,但问题仍然存在。

这是来自地理编码器的错误。

Geocoder getFromLocation --- mService = android.location.ILocationManager$Stub$Proxy@e8c2197, ex = grpc failed, return results = []

请帮忙。

【问题讨论】:

  • 你解决了吗?
  • 任何答案都回答了您的问题吗?

标签: android firebase flutter dart geolocation


【解决方案1】:

尝试在您的模拟器上擦除数据。 重新启动它。

有效。

【讨论】:

    【解决方案2】:

    查看这个 flutter_geocoding 问题(已关闭):https://github.com/Baseflow/flutter-geocoding/issues/23

    提出了两种解决方案:

    1. 创建一个新的模拟器
    2. 在模拟器上停止WiFi,重新启动WiFi并让它找到网络(AndroidWiFi)

    解决方案 2 对我有用。

    【讨论】:

      【解决方案3】:

      尝试添加localeIdentifier参数。为我工作。我的功能代码会是这样的

      List<Placemark> newPlace = await GeocodingPlatform.instance.placemarkFromCoordinates(position.latitude, position.longitude,localeIdentifier: "en");
      

      【讨论】:

        【解决方案4】:

        我遇到了同样的问题。 尝试另一个模拟器(创建另一个模拟器,就像您使用另一个 android 或 ios 设备一样)。 可能是正在模拟的当前设备无法连接到互联网

        【讨论】:

          【解决方案5】:

          这主要是由于您的设备位置发生了变化,如果您使用的是 android 手机等外部设备,那么您应该重启您的设备,它会工作。

          【讨论】:

            【解决方案6】:

            不确定是什么问题,但我最终制作了一个新的 android 模拟器(一个新的模拟设备),它运行良好。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 2010-10-03
              • 1970-01-01
              • 2018-01-13
              • 2018-01-29
              • 1970-01-01
              • 2017-06-06
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多