在manifest.json或者app.json 里面的requiredPrivateInfos配置项添加配置
"mp-weixin" : {
/* 小程序特有相关 */
"appid" : "wx8606b8af9e3b6cf5",
"setting" : {
"urlCheck" : true,
"checkSiteMap": false
},
"usingComponents" : true,
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"requiredPrivateInfos": [
"chooseLocation",
"getLocation",
"chooseAddress"
]
},
然后重新运行编译就可以了