首页 > 编程语言 >解决小程序报错 getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json

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

时间:2023-08-18 13:23:03浏览次数:36  
标签:getLocation 程序 field json 报错 requiredPrivateInfos true

一、unipp项目

打开uniapp项目的配置文件manifest.json,选择“源码视图”。

/* 小程序特有相关 */

"mp-weixin": {
    "appid": "你的开发者id",
    "setting": {
        "urlCheck": true,
        "es6": true,
        "postcss": true,
        "minified": true
    },
    "usingComponents": true,
    "permission": {
        "scope.userLocation": {
            "desc": "你的位置信息将用于小程序位置接口的效果展示"
        }
    },
    "requiredPrivateInfos": [
        "getLocation"
    ]
},

 

标签:getLocation,程序,field,json,报错,requiredPrivateInfos,true
From: https://www.cnblogs.com/shirunfeng/p/17640229.html

相关文章

  • nginx报错: nginx: [error] open() "/opt/nginx/nginx.pid" failed (2: No such file
    出现故障的原因:nginx:[error]open()"/opt/nginx/nginx.pid"failed(2:Nosuchfileordirectory)   服务器重启后,重新启动nginx报错nginx.pid这个文件找不到了!       因为每次重新启动系统,nginx.pid被自动删除。解决方案:    重新生......
  • springboot 打包 时报错:The specified user settings file does not exist: F:\opt\
     解决方法:  ......
  • pyinstaller打包报错及解决
    #使用方法-h,--help查看该模块的帮助信息-F,-onefile产生单个的可执行文件-D,--onedir产生一个目录(包含多个文件)作为可执行程序-a,--ascii不包含Unicode字符集支持-d,--debug产生debug版本的可执行文件-w,--windowed,--noconsolc指定程序运行时不显示命令行窗口(仅对Wind......
  • 关于Node.js 构建中遇到node-gyp报错问题的解决方案记录
    项目今天进行版本更新,在走阿里云流水线的时候,出现了Node.js构建过程报错问题,抱歉详情截图如下: 经过反复排查,最终发现是因为阿里云的npm仓库的问题,于是果断更换npm仓库,执行命令如下:npmconfigsetregistryhttps://registry.npm.taobao.org然后重新 npmi--force 进行......
  • 0-报错记录
    [top]一.编译时错误1.user\led.c(6):error:#144:avalueoftype"unsignedchar"cannotbeusedtoinitializeanentityoftype"GPIO_InitTypeDef":xx类型不能初始化xx结构体类型这个是由于初始化结构体是将{}写成();......
  • csv reader utf-8报错:strict 改为ignore
    classBufferedIncrementalDecoder(IncrementalDecoder):"""ThissubclassofIncrementalDecodercanbeusedasthebaseclassforanincrementaldecoderifthedecodermustbeabletohandleincompletebytesequences."......
  • scrapy爬取图片报错Missing scheme in request url:
    记录一下scrapy爬取图片遇到的坑目标站点:站长素材图片https://sc.chinaz.com/tupian我的核心源代码#Defineyouritempipelineshere##Don'tforgettoaddyourpipelinetotheITEM_PIPELINESsetting#See:https://docs.scrapy.org/en/latest/topics/item-pipeli......
  • C# Microsoft.Win32.TaskScheduler方式创建任务计划程序报错: System.ArgumentExceptio
    使用Microsoft.Win32.TaskScheduler创建任务计划程序可参考本人之前的一篇文章:https://www.cnblogs.com/log9527blog/p/17329755.html最新发现个别账户使用Microsoft.Win32.TaskScheduler创建任务计划程序报错:System.ArgumentException:(12,21):UserId:Account一种情况是账户......
  • SLAM十四讲 Sophus编译报错
    在学习SLAM十四讲的时候,需要使用Sophus,但是在编译Sophus的过程中,总是存在报错。在执行make-j2后,我遇到的错误提示其中有一段是:Eigen::Map<RxSO3Type>shallow_copy=map_of_rxso3;,还有cc1plus:allwarningsbeingtreatedaserrors解决的办法:打开CMakeLists.txt文件,修......
  • 解决 composer 安装 laravel 报错
    执行#composercreate-projectlaravel/laravellaravel9报错Creatinga"laravel/laravel"projectat"./laravel9"Installinglaravel/laravel(v10.2.1) -Downloadinglaravel/laravel(v10.2.1) -Installinglaravel/laravel(v10.2.1):Extract......