Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java android反向地理编码在华为设备上不起作用_Java_Android_Reverse Geocoding_Huawei Mobile Services - Fatal编程技术网

Java android反向地理编码在华为设备上不起作用

Java android反向地理编码在华为设备上不起作用,java,android,reverse-geocoding,huawei-mobile-services,Java,Android,Reverse Geocoding,Huawei Mobile Services,我正试图通过这段代码来反转地理代码lat Geocoder geocoder = new Geocoder(context, Locale.ENGLISH); try { List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1); return addresses; } catch (IOException e) { Log.e(

我正试图通过这段代码来反转地理代码lat

Geocoder geocoder = new Geocoder(context, Locale.ENGLISH);
try {
    List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
            return addresses;
    } catch (IOException e) {
            Log.e("Error : Geocoder", "Impossible to connect to Geocoder", e);
    }
Geocoder-Geocoder=新的地理编码器(context,Locale.ENGLISH);
试一试{
列表地址=geocoder.getFromLocation(纬度,经度,1);
返回地址;
}捕获(IOE异常){
Log.e(“错误:地理编码器”,“无法连接到地理编码器”,e);
}
它在除华为以外的所有设备上都能工作。它在华为设备上是一个例外。客户报告了他的华为设备,在kitkat上运行的华为Y625。我在运行kitkat的华为H30上测试了它,但它也不工作。但是,在所有其他测试设备上运行,包括三星、Nexus等


如果您有任何帮助,我们将不胜感激。

一些android设备出现问题,地理编码器无法工作:


重启似乎可以解决问题。

大多数华为手机不支持GMS地图服务,只支持HMS地图服务。

什么是logcat?任何堆栈跟踪?android.location.Geocoder不是GMS的一部分。它是核心组件