Solve the small program error getLocation: fail the api need to be declared in the requiredPrivateInfos...

When using getLocation in the uniapp WeChat applet, an error occurs

 {errMsg: "getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json"}

 

At this time, first check whether mp-weixin in manifest.json contains the following fields

     "permission" : {             "scope.userLocation" : {                 "desc" : "For your better experience, please confirm to get your location"             }         },         "requiredPrivateInfos" : [ "getLocation" ],




 

 If you have already set and still report an error at the beginning of the message, please check the WeChat developer debugging and release version (versions above 2.6.0 cannot be used, reduce the version to 2.25.4) and then you can get the positioning information

 

Guess you like

Origin blog.csdn.net/m0_68812159/article/details/127813923