chooseLocation:fail the api need to be declared in the requiredPrivateInfos fiel

422 阅读1分钟

uniapp 小程序获取用户定位失败报错信息如下 chooseLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.js

解决办法:

image.png

"permission": {
        "scope.userLocation": {
        "desc": "你的位置信息将用于小程序位置定位"
    }
},
"requiredPrivateInfos": ["getLocation", "chooseLocation"]