当前位置:网站首页>Flutter 集成 amap_flutter_location
Flutter 集成 amap_flutter_location
2022-07-04 08:24:00 【高凤森】
Flutter 集成 amap_flutter_location
今天用 amap_flutter_location 写了个demo,过程中一直报:INVALID_USER_SCODE,error_cod: 1008,下面给大家看下主要流程
一、注册账号
- 在高德开放平台注册开发者账号
- 创建应用,获取 app key
二、配置
- 导入 amap_flutter_location
- gradle build 成功后,将 amap_flutter_location -> build.gradle -> android -> dependencies 节点下,引入插件的
compileOnly修改为api
例如:
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'
}
}
- 清单文件下配置相关权限,并在运行时请求必要权限,具体请参考:高德开放平台
<!-- 这是我自己配置的,亲测可行 -->
<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" />
- 在清单文件
application节点下导入下面的service
ps: 注意,如果没有把compileOnly修改为api,这里就会报错
<service android:name="com.amap.api.location.APSService" />
三、使用
使用的话参考 文档 就足够了,主要是要注意配置的信息是否正确。下面列几个坑点
- 生成 app key 的时候需要证书的 SHA1 值,这里我使用通过命令行生成的 keystore 死活不行,最后通过Android Studio生成的就可以了(怀疑是别名的问题)
- 报错:INVALID_USER_SCODE,报这个错主要就是配置问题。先检查 SHA1 值是否正确;确保没有问题后,在检查配置的包名有没有问题;不对的话,看看自己有没有配置service;最后还不行,就看看 官方回复
边栏推荐
- Oracle stored procedures and functions
- 力扣今日题-1200. 最小绝对差
- Convert datetime string to datetime - C in the original time zone
- 根据数字显示中文汉字
- C # implements a queue in which everything can be sorted
- Three paradigms of database design
- Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
- DM8 database recovery based on point in time
- JVM中堆概念
- Do you know about autorl in intensive learning? A summary of articles written by more than ten scholars including Oxford University and Google
猜你喜欢

Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service

OpenFeign 服务接口调用
![Sports [running 01] a programmer's half horse challenge: preparation before running + adjustment during running + recovery after running (experience sharing)](/img/c8/39c394ca66348044834eb54c68c2a7.png)
Sports [running 01] a programmer's half horse challenge: preparation before running + adjustment during running + recovery after running (experience sharing)

Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14

yolov5 xml数据集转换为VOC数据集

Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future

PCIe knowledge points -010: where to get PCIe hot plug data

NPM run build error
![[performance test] read JMeter](/img/c9/25a0df681c7ecb4a0a737259c882b3.png)
[performance test] read JMeter

论文学习——基于极值点特征的时间序列相似性查询方法
随机推荐
L1-030 one gang one (15 points)
Show server status on Web page (on or off) - PHP
ZABBIX monitoring system deployment
DM8 uses different databases to archive and recover after multiple failures
Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
ZABBIX 5.0 monitoring client
Oracle stored procedures and functions
NewH3C——ACL
Leetcode 23. Merge K ascending linked lists
Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
Do you know about autorl in intensive learning? A summary of articles written by more than ten scholars including Oxford University and Google
弈柯莱生物冲刺科创板:年营收3.3亿 弘晖基金与淡马锡是股东
【Go基础】1 - Go Go Go
【性能测试】一文读懂Jmeter
Activiti常見操作數據錶關系
DM database password policy and login restriction settings
Difference between static method and non static method (advantages / disadvantages)
谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
Ecole bio rushes to the scientific innovation board: the annual revenue is 330million. Honghui fund and Temasek are shareholders
1. Getting started with QT