getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json
错误信息
解决方法:
"mp-weixin" : {
/* 小程序特有相关 */
"appid" : "",
"setting" : {
"urlCheck" : false,
"es6" : true,
"minified" : true,
"postcss" : true
},
"usingComponents" : true,
"requiredPrivateInfos":[
"getLocation"
],
"lazyCodeLoading": "requiredComponents"
},
添加
"requiredPrivateInfos":[
"getLocation"
],