【发布时间】:2018-12-05 08:45:48
【问题描述】:
Android Studio 3.1.3
安卓 6.0
Gradle 4.4
我想获得新的 Google 地图 API 密钥。所以这里是我的步骤:
在我的 Android Studio 项目中,我打开文件:“googel_maps_api.xml”
-
复制到剪贴板下一个网址:
在谷歌控制台中我选择我的项目并点击按钮
将生成的密钥复制到文件“googel_maps_api.xml”的字段google_maps_key
在清单文件中添加元数据android:name="com.google.android.geo.API_KEY":
这里是我使用的google api:
重启我的安卓应用
-
但是在 logcat 上我得到错误:
E/Google Maps Android API( 9757): Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map. E/Google Maps Android API( 9757): In the Google Developer Console (https://console.developers.google.com) E/Google Maps Android API( 9757): Ensure that the "Google Maps Android API v2" is enabled. E/Google Maps Android API( 9757): Ensure that the following Android Key exists: E/Google Maps Android API( 9757): API Key: AIzaSyCTvKejzCdZxxxxxxxxxxSIPG9DkegNss4-VJ8fjVt4 E/Google Maps Android API( 9757): Android Application (<cert_fingerprint>;<package_name>): B7:CE:53:19:C4:xx:Bxx2C:C6:51:35:AD:32:47:1E:53:6B:1A:0D:B9;com.myprojectcustomer.debug
结果地图没有显示。
【问题讨论】:
标签: android google-maps