我收到此错误:
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>):
我看到的不是地图正常工作,而是:
In my 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
这就是我需要的 Google 地图,对吗?我正在查看列表https://developers.google.com/android/guides/setup我假设Google Location and Activity Recognition - com.google.android.gms:play-services-location:16.0.0
是我需要的谷歌地图。它是否正确?
更新1:我已经启用了 Android 版 Maps SDK:
错误说:Ensure that the "Google Maps Android API v2" is enabled.
。是否指的是Maps SDK for Android
我在这个屏幕截图中显示的UPDATE 1?
更新2: I have Maps SDK for Android
启用:
当我点击MANAGE
按钮,我可以转到配置我在其中显示的凭据的部分UPDATE 1.
更新3:我看到地图在模拟器上的所有 Android 版本上都正确显示。但在物理设备上,地图永远不会显示。当我在实体手机上运行该应用程序时,我看到了 Google 徽标和红色气球,但现在看到了地图。仅在模拟器上一切正常。有什么想法吗?
更新4:请参阅我的解决方案https://stackoverflow.com/a/56307654/4242086.