【uni-app报错】选择地址:fail the api need to be declared in the requiredPrivateInfos field in app/ext.json

微信开发者社区-官方通告
自 2022 年 7 月 14 日起,开发者如需在最新版本发布后使用地理位置相关接口,除需完成接口权限开通外,还需在 app.json(或ext.json)配置环节。点击查看

解决方法:

一、uni-app项目
  在项目根目录中找到 manifest.json 文件,在左侧导航栏选择源码视图,找到mp-weixin 节点,在节点后面加上:

"requiredPrivateInfos": [
    "getLocation",
    "onLocationChange",
    "startLocationUpdateBackground"
    "chooseAddress"
 ]

 二、原生小程序项目
在根目录的 app.json 文件中加上requiredPrivateInfos节点,配置信息参考,点击查看

 

posted @ 2022-09-15 15:56  kai·james  阅读(557)  评论(0)    收藏  举报