【问题标题】:Android Mapview show white tiles without any mapAndroid Mapview显示没有任何地图的白色瓷砖
【发布时间】:2013-04-12 22:06:02
【问题描述】:

我为我的android application 生成了MD5SHA fingerprint。然后我去谷歌获取map api for android with SHA。因为我在 google 中没有看到任何地方可以使用MD5 获取 api。即使我在manifest file 中设置INTERNET permission 并定义我的布局如下,我的活动中也看不到谷歌地图

<com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="AIzaSyCfaFYAg1ql6hHN..."

此外,我在一篇文章中看到,如果我获得带有 SHA 指纹的 api 密钥,它将无法正常工作。但谷歌只要求 SHA 获取 api 密钥。

【问题讨论】:

    标签: android google-maps google-maps-api-3 android-widget


    【解决方案1】:

    如果地图没有显示,那么它与您的钥匙有关。您需要 2 个不同的密钥,一个用于调试,一个用于发布到市场

    【讨论】:

    【解决方案2】:

    让我回答我希望从 SO 社会得到解决方案的问题。

    1. 确保您已安装 Google Play 服务

    2. 然后从C:\Program Files\adt-bundle-windows-x86_64-20130219\sdk\extras\google\google_play_services\libproject\google-play-services_lib 获取google-play-services_lib 作为Android Project From Existing Code 进入您的工作区

    3. 将此添加到您的项目 Library 为 (项目->属性->Android->库->添加)

    4. 然后你需要在你的应用中使用谷歌地图完成 从谷歌获取密钥。只需按照说明进行操作即可 Creating an API Project 的底部https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key

    5. 就是这样。玩得开心

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-11
      • 2013-01-01
      • 2015-07-31
      • 2014-06-27
      • 2017-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多