如何在Android上连接到Google Maps API v2

时间:2014-06-18 16:02:55

标签: google-maps authentication google-maps-android-api-2 heatmap

我很难通过Heatmap演示应用程序(https://github.com/googlemaps/android-maps-utils)连接到Google Maps API。我按照https://developers.google.com/maps/documentation/android/utility/heatmap的说明设置我的项目并运行,但问题是地图没有显示在屏幕上,我在logcat中收到这些错误:

I/Google Maps Android API(31950): Failed to contact Google servers. Another attempt will be made when connectivity is established.

E/Google Maps Android API(31950): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

我将以下内容添加到我的清单中(<MY_API_KEY>是我从https://code.google.com/apis/console得到的值,必须上传我的SHA1密钥后跟分号 “;”包名称“com.google.maps.android.utils.demo”):

    <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

    <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="<MY_API_KEY>"/>

有关如何使身份验证工作的任何想法? (假设这是问题)

0 个答案:

没有答案