当前位置:网站首页>Flutter integrated amap_ flutter_ location
Flutter integrated amap_ flutter_ location
2022-07-04 08:24:00 【Gao Fengsen】
Flutter Integrate amap_flutter_location
Use today amap_flutter_location Wrote a demo, Keep reporting in the process :INVALID_USER_SCODE
,error_cod
: 1008, Now let's show you the main process
One 、 Registered account
- Register a developer account on Gaode open platform
- Create an , obtain app key
Two 、 To configure
- Import amap_flutter_location
- gradle build After success , take amap_flutter_location -> build.gradle -> android -> dependencies Under the node , Introduction of plug-ins
compileOnly
It is amended as followsapi
for example :
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 16
}
lintOptions {
disable 'InvalidPackage'
}
dependencies {
//compileOnly 'com.amap.api:location:5.6.0'
api 'com.amap.api:location:5.6.0'
}
}
- Configure relevant permissions under the manifest file , And request the necessary permissions at run time , Please refer to : Gaud open platform
<!-- I configured it myself , Pro feasible measurement -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
- In the list file
application
Import the following... Under the node service
ps: Be careful , If you don't putcompileOnly
It is amended as followsapi
, There will be a mistake here
<service android:name="com.amap.api.location.APSService" />
3、 ... and 、 Use
If used, refer to file That's enough , Mainly pay attention to whether the configuration information is correct . Here are a few pits
- Generate app key When you need a certificate SHA1 value , Here I use the command line generated keystore I can't live or die , Finally through Android Studio Generated is ok ( Doubt is the problem of alias )
- Report errors :INVALID_USER_SCODE, This error is mainly a configuration problem . First check SHA1 Is the value right ; After making sure there are no problems , Check whether there is any problem with the configured package name ; If not , See if you have configuration service; Finally, not yet , Just look at it. Official reply
边栏推荐
- 团体程序设计天梯赛-练习集 L2-002 链表去重
- @Role of requestparam annotation
- DM database password policy and login restriction settings
- Leetcode 23. 合并K个升序链表
- [go basics] 2 - go basic sentences
- C#实现一个万物皆可排序的队列
- 根据数字显示中文汉字
- Go h*ck yourself:online reconnaissance (online reconnaissance)
- SSRF vulnerability exploitation - attack redis
- Newh3c - network address translation (NAT)
猜你喜欢
随机推荐
Oracle stored procedures and functions
Do you know about autorl in intensive learning? A summary of articles written by more than ten scholars including Oxford University and Google
【Go基础】2 - Go基本语句
What determines vacuum permittivity and vacuum permeability? Why do these two physical quantities exist?
DM8 database recovery based on point in time
[CV] Wu Enda machine learning course notes | Chapter 9
Conversion of yolov5 XML dataset to VOC dataset
Flask 常用组件
墨者学院-phpMyAdmin后台文件包含分析溯源
1. Getting started with QT
PHP converts seconds to timestamps - PHP
PCIe knowledge points -010: where to get PCIe hot plug data
Use preg_ Match extracts the string into the array between: & | people PHP
string. Format without decimal places will generate unexpected rounding - C #
DM database password policy and login restriction settings
AcWing 244. Enigmatic cow (tree array + binary search)
2022 examination questions for safety managers of metal and nonmetal mines (underground mines) and examination papers for safety managers of metal and nonmetal mines (underground mines)
What does range mean in PHP
真空介电常数和真空磁导率究竟是由什么决定的?为何会存在这两个物理量?
Unity write word