uni.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
});
- 发布:2024-07-20 00:46
- 更新:2024-07-20 18:08
- 阅读:608
【报Bug】安卓调用 uni.chooseLocation报错TypeError: Cannot read property 'points' of undefined
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 10
HBuilderX类型: 正式
HBuilderX版本号: 4.23
手机系统: Android
手机系统版本号: Android 13
手机厂商: 华为
手机机型: 华为 nova 5i pro
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
uni.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
});
uni.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
});
预期结果:
能正常使用
能正常使用
实际结果:
正式调用
正式调用
bug描述:
安卓调用 uni.chooseLocation报错如下
[JS Framework] Failed to execute the callback function:
TypeError: Cannot read property 'points' of undefined
00:44:06.572 reportJSException >>>> exception function:WEEX_CALL_JAVASCRIPT, exception:JavaScript execute error!Uncaught TypeError: Cannot read property 'points' of undefined
at (/__uniappchooselocation.js.nvue:1:28376)
2 个回复
d***@163.com
我的这边也是报这个错误
DCloud_UNI_GSQ
参考:https://ask.dcloud.net.cn/question/195066