2***@qq.com
2***@qq.com
  • 发布:2023-01-06 11:08
  • 更新:2023-06-25 15:01
  • 阅读:307

【报Bug】急急急 !!! ios 设备uni.getLocation 报错:"code": -1501

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: macOS Monterey 12.6.2

HBuilderX类型: 正式

HBuilderX版本号: 3.6.15

手机系统: iOS

手机系统版本号: iOS 14

手机厂商: 模拟器

手机机型: 16.2 型号号码:A2649

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

操作步骤:

getLocation() {
var that = this
console.log("weizhi");
uni.getLocation({
type: 'wgs84',
geocode: true, //设置该参数为true可直接获取经纬度及城市信息
success: function(res) {
console.log(res, 'res');
that.form.lat = res.latitude
that.form.lng = res.longitude
},
fail: (error) => {
console.log("error", error);
this.openSetting() // 小程序打开设置位置
}

            });  
        },

预期结果:

ios 安卓 小程序端, uni.getLocation可以正常获取经纬度信息

实际结果:

ios或许不到经纬度信息,报错:{
"errMsg": "getLocation:fail 坐标地址解析失败,https://ask.dcloud.net.cn/article/282",
"errCode": -1501,
"code": -1501
}

bug描述:

获取经纬度的时候,APP端 ios 返回"code": -1501
之前版本是好的,正常获取经纬度信息,2022年12月28日 重新发布版本后 获取不到经纬度信息
代码:getLocation() {
var that = this
console.log("weizhi");
uni.getLocation({
type: 'wgs84',
geocode: true, //设置该参数为true可直接获取经纬度及城市信息
success: function(res) {
console.log(res, 'res');
that.form.lat = res.latitude
that.form.lng = res.longitude
},
fail: (error) => {
console.log("error", error);
this.openSetting() // 小程序打开设置位置
}

            });  
        },  

报错信息:{
"errMsg": "getLocation:fail 坐标地址解析失败,https://ask.dcloud.net.cn/article/282",
"errCode": -1501,
"code": -1501
}

2023-01-06 11:08 负责人:无 分享
已邀请:
奥利奥饼干

奥利奥饼干

请问解决了吗?

要回复问题请先登录注册