改变密钥库后无法显示谷歌地图 [英] Cannot display google map after changing keystore

查看:206
本文介绍了改变密钥库后无法显示谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可行的地图应用程序,但之后,我改变了密钥库,还可以创建API密钥,并更新到我的Andr​​oidMenifest,地图不显示了,

I had a workable map app, but after i changed the keystore, also create api key, and update it into my AndroidMenifest, the map was not display anymore,

,我发现一些有趣的事情,该证书的指纹和API密钥错误日志是我创建密钥库和控制台API密钥完全不同的。

and I found something interesting, that the certificate Fingerprint and api Key in error log are totally different as keystore and console api key I created.

我的API密钥AIzaSyA,XXXXXXXXXXXXXXXXXXXXJhfQCboM
和SHA1是FE:CF:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:8A:0D

My api key is AIzaSyA-XXXXXXXXXXXXXXXXXXXXJhfQCboM and SHA1 is FE:CF:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:8A:0D

下面是我的清单如下:

<application
    android:allowBackup="true"
    android:icon="@drawable/es100x100"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    android:debuggable="true" >

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyA-XXXXXXXXXXXXXXXXXXXXXXXJhfQCboM" />

    <activity
        android:name=".MainFragmentActivity"
        android:theme="@android:style/Theme.NoTitleBar"
        android:windowSoftInputMode="adjustPan"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

错误日志

Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
Ensure that the following correspond to what is in the API Console: Package Name: esoft.com.edm, API Key: AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxx_eSh-E, Certificate Fingerprint: 5BFD72xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxD031
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

希望有一个人可以让我找出我错过了......

hope some one can let me figure out what I missed...

推荐答案

如果你确信你的API密钥是正确的,的确与你同签署的密钥库注册的API密钥,你可以检查几件事情。

If you are sure that your API key is correct and is indeed the API key registered with the keystore that you have signed with, you could check a few things.


  1. 你改变你的应用程序的包名新的东西?然后,你将需要添加对谷歌API控制台上的新包名称的新条目。

  1. Did you change the package name of your app to something new? Then you would require to add a new entry for your new package name on the Google API console.

该API密钥的应用程序缓存。即使将其更改为一个新的,并安装后,该应用程序使用旧的一段时间。你可以尝试卸载并重新安装应用程序,看看是否有帮助。

The API key is cached in the app. Even after changing it to a new one, and installing it, the app uses the old one for some time. You could try uninstalling and re-installing the app, and see if it helps.

这篇关于改变密钥库后无法显示谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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