谷歌地图签署了Android中的api密钥错误 [英] Google map signed api key errors in Android

查看:30
本文介绍了谷歌地图签署了Android中的api密钥错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从调试映射密钥切换到签名映射密钥时,我的映射停止工作.我在 logcat 中收到以下错误:

When I switched from my debug map key to my signed map key my maps stop working. I get the following errors in logcat:

09-03 18:18:04.112: WARN/System.err(4073): IOException processing: 26
09-03 18:18:04.112: WARN/System.err(4073): java.io.IOException: Server returned: 3
09-03 18:18:04.112: WARN/System.err(4073):     at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
09-03 18:18:04.112: WARN/System.err(4073):     at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
09-03 18:18:04.112: WARN/System.err(4073):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
09-03 18:18:04.112: WARN/System.err(4073):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
09-03 18:18:04.112: WARN/System.err(4073):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
09-03 18:18:04.112: WARN/System.err(4073):     at java.lang.Thread.run(Thread.java:1019)

我已经仔细检查了所有内容,权限和库都已到位.我重新创建了烧焦的密钥,但没有运气.

I've double checked everything, permissions and library are in place. I've recreated the singed key and no luck.

有什么想法吗?

推荐答案

我遇到了同样的问题,我认为互联网上没有任何有用的答案,所以希望这对未来的每个人都有帮助.

I had the same problem and I figured there wasn't any helpful answer around on the internet so hoping this should help everyone in the future.

使用 Android 版 GoogleMaps 时,您需要两个键 - 调试和发布.

When using GoogleMaps for Android, you need two keys - debug and release.

调试"键是一种误导性术语.在 Eclipse 中开发应用程序时也将使用此密钥.所以本质上,使用调试密钥进行开发、测试、调试.

The "debug" key is kind of a misleading term. This key is also to be used when you develop the app in Eclipse. So essentially, use the debug key for development, testing, debugging.

当您准备好将应用启动到 Market 时,在 AndroidManifest.xml 中设置 android:debuggable="false" 并使用签名 API 密钥.

When you're ready to launch the app to Market, set the android:debuggable="false" in the AndroidManifest.xml and use the Signed API key.

当使用签名的 API 密钥时, MapView 只会在从 Android Market 安装应用程序时显示.因此,从 Eclipse(运行方式、调试方式等)或命令行安装应用程序 (adb install) 不会显示 MapView.请放心,一旦应用程序在市场中 - 您下载它,<​​code>MapView 将显示.

When using the signed API key, the MapView will show up ONLY when the app is installed from the Android Market. So, installing the app from Eclipse (Run As, Debug As, etc) or command line (adb install) won't show the MapView. Rest assured, once the app is in the Market - you download it and the MapView will show up.

使用签名的 API 密钥,如果您从 Eclise 部署应用程序,您将收到服务器返回 3,IOProcessing 异常 26"作为警告 - 只需忽略它.

With the signed API key, if you deploy the app from Eclise, you will get a "Server returned 3, IOProcessing Exception 26" as a warning - just ignore it.

注意:还要确保同一个 MapView 没有重复的实例.如果您的应用程序需要x"没有.MapViews,生成x"号.新的签名密钥(每个 MapView 一个),因为 GoogleMaps 对单个 MapView 实例有查询限制.

Note: Also ensure there are no duplicate instances of the same MapView. If your app needs "x" no. of MapViews, generate "x" no. of new signed keys (one for each MapView) since GoogleMaps has a query limit for a single MapView instance.

要获取这两个密钥,请按照 在 Android 上获取 GoogleMaps 的 API 密钥的步骤操作.

For getting both the keys, follow the steps for Obtaining API keys for GoogleMaps on Android.

快乐编码!

更新:

上面用于获取 api 密钥的链接现已弃用.请参阅获取适用于 GoogleMaps Android API v2 的 API 密钥.

The link above for obtaining api keys is now a deprecated procedure. Refer Obtaining API keys for GoogleMaps Android API v2 going forward.

这篇关于谷歌地图签署了Android中的api密钥错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆