草庐IT

小程序收货地址报错chooseAddress:fail the api need to be declared in the requiredPrivateInfos field inapp.json

项目场景:        最近做的小程序商城项目获取微信小程序收货地址接口wx.chooseAddress时,返回errMsg为: "chooseAddress:failtheapineedtobedeclaredintherequiredPrivateInfosfieldinapp.json/ext.json" 原因分析:这是由于微信官方做了优化,自2022年7月14日后发布的小程序,若使用该接口,需要在app.json中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。详情请看小程序官方公告:地理位置接口新增与相关流程调整解决方案:一、uni-app项目打开小

解决小程序报错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":"你的位置信息将用于小程序位置接口的效果展示" } },

解决小程序报错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":"你的位置信息将用于小程序位置接口的效果展示" } },