flutter引入高德地图_关于flutter引入高德地图插件,接上篇

插件:https://pub.flutter-io.cn/packages/amap_base

参考签名keystore:https://blog.csdn.net/weixin_44567104/article/details/90377912

参考解决用户key不正确或过期,md5不正确问题:https://blog.csdn.net/m00123456789/article/details/71404282?tdsourcetag=s_pctim_aiomsg

amap_base算是评分比较高的,但作者比较忙一直没更新问题也比较多

1、生成keystore文件,放到根目录下。参考https://blog.csdn.net/weixin_44567104/article/details/90377912

2、生成keystore.properties文件,加入配置

storePassword=xxx

keyPassword=xxx

keyAlias=xxx

#这里是app下的build.gradle加载,android.keystore在上级目录,就是根目录

storeFile=../android.keystore

3、app下的build.gradle加入配置

//load keystore签名配置,地图、支付等服务都要用到

def keystorePropertiesFile = rootProject.file("keystore.properties")

def keystoreProperties= newProperties()

keystoreProperties.load(newFileInputStream(keystorePropertiesFile))

android {

...//签名配置

signingConfigs {

debug {

keyAlias keystoreProperties['keyAlias']

keyPassword keystoreProperties['keyPassword']

storeFile file(keystoreProperties['storeFile'])

storePassword keystoreProperties['storePassword']

}

release {

keyAlias keystoreProperties['keyAlias']

keyPassword keystoreProperties['keyPassword']

storeFile file(keystoreProperties['storeFile'])

storePassword keystoreProperties['storePassword']

}

}

buildTypes {

profile {

initWith debug

}

debug {

signingConfig signingConfigs.debug

}

release {//TODO: Add your own signing config for the release build.//Signing with the debug keys for now, so `flutter run --release` works.

signingConfig signingConfigs.release

}

}

}

4、修改AndroidManifest.xml

5、一些问题,基本都是验签没过,sha1和packagename一定要对应上,android工程配置也要一致。用户key不正确一般加上keystore验签就行了,md5不正确应该是包名不匹配

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值