草庐IT

requiredPrivateInfos

全部标签

解决小程序报错getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json

报错如下:解决方案:一、uniapp项目打开uniapp项目的配置文件manifest.json,选择“源码视图”。 光上图,不上代码的,不是好司机。/*小程序特有相关*/"mp-weixin":{ "appid":"你的开发者id", "setting":{ "urlCheck":true, "es6":true, "postcss":true, "minified":true }, "usingComponents":true, "permission":{ "scope.userLocation":{ "desc":"你的位置信息将用于小程序位置接口的效果展示" } },
12