HarmonyOS getLastLocation报错3301200?

为什么有权限了,还没有数据

出以下错误:

getLastLocation errCode:3301200,errMessage:BussinessError 3301200: Failed to obtain the geographical location., {error.name:Error, error.message:BussinessError 3301200: Failed to obtain the geographical location.} ,

阅读 570
1 个回答

一、getLastLocation 是获取最后一次定位的信息。如果以前没有定位成功过,通过此方法确实是获取不到信息的。还可以检查一下下方的可能性:

1.GNSS信号弱,导致定位超时。

2.网络定位异常,导致定位超时。

3.定位结果不满足定位请求参数中的精度要求(maxAccuracy),导致定位超时。

4.系统无缓存位置,导致获取上一次位置失败。

5.系统时间设置错误,导致获取位置失败。

二、具体可以查看一下下方的链接:

https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/errorcode-geolocationmanager-V5\#section3301200-定位失败未获取到定位结果