移动地图API项目到不同的开发计算机。我需要一个新的API密钥? [英] Moving Maps API project to a different development computer. Do I need a new API key?
问题描述
我写的是Android 5.1与Android Studio的一个应用程序,使用谷歌地图API第2版。我复制了项目的所有文件,并将它们转移到一个新的计算机。然后,我从台新电脑做了构建和手机上安装的应用程序。有与构建和安装没有任何问题。
I am writing an App in Android 5.1 with Android Studio that uses the Google Maps API v2. I copied the all the project's files and moved them to a new computer. Then I did a build from the new computer and installed the App on a phone. There were no problems with the build and install.
但我得到一个运行时错误朴素灰色的矩形,其中地图应该的。
But I get a runtime error and plain grey rectangle where the map should be.
20 08-09:52:39.947 14052-14183 / cetlot.com.sisuyouth E / B:认证服务器上的失败>。
08-09 20:52:39.947 14052-14183 / cetlot.com.sisuyouth E /谷歌地图Android版API:授权失败结果
请参阅 https://developers.google.com/maps/documentation/android/start一>如何正确设置地图。
08-09 20:52:39.956 14052-14183 / cetlot.com.sisuyouth E /谷歌地图Android版API:>在谷歌开发者控制台(的 https://console.developers.google.com )
确保谷歌地图Android版API V2已启用。
确保以下的Android项是否存在:
API密钥:AIzaSyCR2CMntoLW8xubFsYMpENSdKoWUcyKG2w
Android应用程序(;):39:45:E7:0B:45:8B:17:0D:56:98:B4:D3:28:9C:16:41:46:65:71:20; cetlot.com。 sisuyouth
08-09 20:52:39.947 14052-14183/cetlot.com.sisuyouth E/b﹕ Authentication failed >on the server. 08-09 20:52:39.947 14052-14183/cetlot.com.sisuyouth E/Google Maps Android API﹕ Authorization failure.
Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map. 08-09 20:52:39.956 14052-14183/cetlot.com.sisuyouth 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: AIzaSyCR2CMntoLW8xubFsYMpENSdKoWUcyKG2w Android Application (;): 39:45:E7:0B:45:8B:17:0D:56:98:B4:D3:28:9C:16:41:46:65:71:20;cetlot.com.sisuyouth
我是否需要为新的计算机的新的API密钥?并将在为此目的错误信息工作证书指纹?我有此计算机上的keytool工具的麻烦。
Do I need a new API key for the new computer? And will the certificate fingerprint in the error message work for that purpose? I am having trouble with the keytool utility on this computer.
推荐答案
看来你需要添加/验证您的密钥存储文件中获得的SHA1键。如果你正在使用debug.keystore文件,然后从JDK - > BIN文件夹
It seems you need to add/Verify SHA1 key obtained from your keystore file. If you are using debug.keystore file then from JDK --> BIN folder
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
和验证,如果生成的密钥mactches你加入谷歌API控制台
and verify if generated key mactches to the SHA1 you added to Google API Console
这篇关于移动地图API项目到不同的开发计算机。我需要一个新的API密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!