Android 应用谷歌地图显示灰色瓷砖而不是地图!
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2641197/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android app google maps showing grey tiles and not map!
提问by Capsud
I followed this guide here perfectly and have gone through it again but when I run the program on my google avd the page loads but only grey tiles appear and it doesn't show a map which it should.
我在这里完美地遵循了本指南,并再次浏览了它,但是当我在我的 google avd 上运行该程序时,页面加载但只出现灰色图块,并且没有显示它应该显示的地图。
Does anyone have any ideas?
有没有人有任何想法?
Thanks
谢谢
采纳答案by Thilo-Alexander Ginkel
I was facing the same issue a couple of days ago and figured out that something related to APK signing was acting weird. The solution was to set the “Custom debug keystore” setting (empty by default) to the same value as the “Default debug keystore” in the Eclipse preferences.
几天前我遇到了同样的问题,并发现与 APK 签名相关的事情很奇怪。解决方案是将“自定义调试密钥库”设置(默认为空)设置为与 Eclipse 首选项中的“默认调试密钥库”相同的值。
回答by CommonsWare
You either have the wrong value for android:apiKey
in your MapView
, or you do not have the INTERNET
permission, or you do not have Internet access.
你要么有错误的价值android:apiKey
在您MapView
,或者您没有INTERNET
权限,或者你没有上网。
回答by scottyab
Worth remembering when you are ready to release to marketplace to generate new RSA fingerprint and API key from your actual keystore as opposed to the default debug keystore.
当您准备好发布到市场以从您的实际密钥库而不是默认调试密钥库生成新的 RSA 指纹和 API 密钥时,值得记住。
Also if you are developing on different machines you'll have different keystores and hence different RSA fingerprints. That had me stumped for a while when google maps suddenly stopped working when developing at home.
此外,如果您在不同的机器上开发,您将拥有不同的密钥库,因此会有不同的 RSA 指纹。当谷歌地图在家里开发时突然停止工作时,这让我难住了一段时间。
回答by Louis
I had the same problem : grey tiles and not map.
我有同样的问题:灰色瓷砖而不是地图。
My solution was to move :
我的解决方案是移动:
<uses-permission android:name="android.permission.INTERNET" />
outside <application>< /application>
外部 <application>< /application>
It works now! I hope it can help anybody!
它现在有效!我希望它可以帮助任何人!
回答by Carlos Zinato
I solved this problem in another way: I'm working on hackintosh mac os. So I gone to terminal and type:
我以另一种方式解决了这个问题:我正在研究 hackintosh mac os。所以我去了终端并输入:
keytool -list -alias androiddebugkey -keystore /Users/hackintosh/.android/debug.keystore -storepass android -keypass android
keytool -list -alias androiddebugkey -keystore /Users/hackintosh/.android/debug.keystore -storepass android -keypass android
It generated me a certificate's MD5 fingerprint like: "94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98".. After it, I went to google maps api site
它为我生成了一个证书的 MD5 指纹,如:“94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98”..之后,我去了谷歌地图api站点
https://developers.google.com/android/maps-api-signup?hl=en-US
https://developers.google.com/android/maps-api-signup?hl=en-US
and paste the certificate's MD5 fingerprint. The google maps api returns me an API Key that I glued in the API Key field on my XML's app. And there's no more grey fields =)
并粘贴证书的 MD5 指纹。谷歌地图 API 返回一个 API 密钥,我将其粘贴在我的 XML 应用程序的 API 密钥字段中。没有更多的灰色领域 =)
回答by sumit pandey
I dont know weather this will work for you or not.
我不知道天气这对你是否有用。
Try following methods:
尝试以下方法:
1) Check your API key when you are connected to svn as you might be sharing other person's key. If you do not have one then create it from this link: google map md5 generation
1) 当您连接到 svn 时检查您的 API 密钥,因为您可能正在共享其他人的密钥。如果您没有,请从此链接创建它:google map md5 generation
and then generate api key from api key
2) check manifest for INTERNET permissions
2)检查互联网权限清单
android.permission.INTERNET
android.permission.INTERNET
3)sometimes problem arises due to AVD. Go to Avd manager and increase Max VM application heap size and device RAM size.
3) 有时由于 AVD 会出现问题。转到 Avd 管理器并增加最大 VM 应用程序堆大小和设备 RAM 大小。
回答by Jason Knight
If you're are using the debug keystore to sign your app you need to generate a key for it too, in addition to the cert you plan to use for production.
如果您使用调试密钥库来签署您的应用程序,除了您计划用于生产的证书之外,您还需要为其生成一个密钥。