我需要不同的SHA1键来执行Google地图吗? [英] Does i need different SHA1 key to perform Google Map

查看:130
本文介绍了我需要不同的SHA1键来执行Google地图吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

器Hj。我正在使用谷歌地图API v2的项目。在我的办公室里,使用cert_fingerprint关键字 1

Hj. I am using google map API v2 for project. In my office, it works fine with cert_fingerprint key 1

可以正常工作。但是在家里做这件事时,我得到一张空白的谷歌地图。跟踪日志我可以看到:

But when doing it in home, i got a blank google map. Trace log i can see this:

03-17 04:40:44.288 12461-12510 / com.dump.dms E / Google Maps Android API:在Google Developer中控制台( https://console.developers.google.com
确保Google地图Android API v2已启用。
确保存在以下Android密钥:
API密钥:AIzaSyDEE3COcEWPZte_cpPl ********* L2Cm_A
Android应用程序(< cert_fingerprint>;< package_name>):EF: FA:C1:36:BD:FA:D6:6A:DE:**:**:53:C8:8B:16:C1:15:C7:ED; com.dump.dms(call cert_fingerprint key 2

03-17 04:40:44.288 12461-12510/com.dump.dms E/Google Maps Android API﹕ In the Google Developer Console (https://console.developers.google.com) Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists: API Key: AIzaSyDEE3COcEWPZte_cpPl*********L2Cm_A Android Application ( < cert_fingerprint > ;< package_name >): EF:FA:C1:36:BD:FA:D6:6A:DE: ** : ** : ** :53:C8:8B:16:C1:15:C7:ED;com.dump.dms (call cert_fingerprint key 2)

所以我必须替换为cert_fingerprint键 2 。然后我的应用程序正常工作。

So i must to replace to cert_fingerprint key 2 . Then my app works normally.

任何人都可以解释为什么我需要2个cert_fingerprint这样的密钥?如何只使用一个cert_fingerprint键?

Could anyone explain why i need 2 cert_fingerprint key like that? How can i use only one cert_fingerprint key ?

推荐答案

在将应用程序部署为调试版时,问题在于您的调试.keystore与在工作中不同。在您的办公室中,您使用该debug.keystore生成用于生成Google Maps API密钥的SHA1密钥。现在,当您在家中部署应用时,会使用另一个debug.keystore,并且该键不匹配。

When deploying your app as debug build, the problem is that at home your debug.keystore is different than at work. In your office, you used that debug.keystore to generate the SHA1 key which you used for generating the Google Maps API Key. When you deploy your app at home now, another debug.keystore is used and the key doesn't match.

最简单的方法是将您的debug.keystore从您的工作环境中提取文件并在家中使用。但是,您也可以像这样在您的Google API控制台中输入多个SHA1密钥(对于您使用的每个环境,这意味着您需要为所有环境的debug.keystore文件创建SHA1密钥):

The easiest way would be to copy your the debug.keystore file from your work environment and use it at home. But you can also enter multiple SHA1 keys in your Google API console like this (for every environment you use which means you need to create SHA1 keys for the debug.keystore files of all your environments):

AB:0A:05:...:12;com.example
CD:35:01:...:2B;com.example

将部署为发布版本时会出现同样的问题(使用导出时需要生成的密钥库文件Android App as APK文件)

The same problem appears when you deploy as release build (using the keystore file you need to generate when exporting your Android App as APK file)

另请参阅: http://developer.android.com/tools/publishing/app-signing.html#debug-mode

这篇关于我需要不同的SHA1键来执行Google地图吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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