我收到此错误:
E/Google Maps Android API: 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: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: [The key...]
Android Application (<cert_fingerprint>;<package_name>):
我看到的不是地图正常工作,而是:
在我的app/build.gradle
,我有这个:
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.2.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
play-services-location
是我需要的谷歌地图,对吗?我正在查看https://developers.google.com/android/guides/setup上的列表,我认为这Google Location and Activity Recognition - com.google.android.gms:play-services-location:16.0.0
是我需要的谷歌地图。这个对吗?
更新 1:我已经启用了 Maps SDK for Android:
错误说:Ensure that the "Google Maps Android API v2" is enabled.
。它是指Maps SDK for Android
我在此UPDATE 1的屏幕截图中显示的内容吗?
更新 2:我已Maps SDK for Android
启用:
当我单击该MANAGE
按钮时,我可以转到配置我在UPDATE 1中显示的凭据的部分。
更新 3:我看到地图在模拟器的所有版本的 Android 上都正确显示。但是在物理设备上,地图永远不会出现。我看到了 Google 徽标和红色气球,但现在当我在实体手机上运行应用程序时看到的是地图。只有在模拟器上一切正常。任何想法为什么?
更新 4:在https://stackoverflow.com/a/56307654/4242086查看我的解决方案。