【发布时间】:2018-01-17 11:45:48
【问题描述】:
我使用 maps api 在我的 Android 应用程序中集成了 Google Maps,但是当我启动它时它保持空白并且还显示 Google 徽标(见图)。 this is what the app shows
In builde app gradle I have:
dependencies{
implementation 'com.google.android.gms:play-services-maps:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
在 manifest.xml 我有:
<uses-permission android:name="com.vallabh.googlemapspractice.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="The Api Key which I got from google console" />
【问题讨论】:
-
查看logcat,是否有错误信息等;比如无效的apikey
-
首先你应该关注最新的文档......我确信当你使用 gradle 的 google-service 插件 时,不需要
"com.google.android.geo.API_KEY"。 ..但你必须检查真正需要什么(如何设置) -
我通过重新安装 Android Studio 解决了这个问题。
标签: android google-maps google-play-services google-maps-android-api-2