本人开发使用的是android studio
一、下载谷歌服务包(Google Play)
二、创建谷歌地图项目
1.Android Studio 菜单栏中的 File,然后点击 New、New Project
2.在“Add an activity to Mobile”对话框中选择 Google Maps Activity。
三、获取谷歌地图API秘钥
申请秘钥链接https://developers.google.com/maps/documentation/android-api/?hl=zh-cn
具体过程自行百度
四、修改秘钥
Android Studio 会在编辑器中打开 google_maps_api.xml,替换string中的秘钥
运行错误:
The number of method references in a .dex file cannot exceed 64K.
错误原因:
大部分都是因为包的重复导入。
解决办法:
1.app的 build.gradle 中,在dependencies 中添加
compile 'com.android.support:multidex:1.0.1'
2.在defaultConfig 中添加
multiDexEnabled true
3.在 AndroidManifest.xml 中的 applicat