谷歌地图Android的API V2:无法加载地图。无法联系谷歌服务器地图、加载、服务器、API

2023-09-07 04:08:55 作者:吃饭从不留名

我尝试使用谷歌地图Android的API v2和我已经创建从我的发布证书的SHA1键。

I'm trying to use Google Maps Android API v2, and I have already created the SHA1 key from my release cert.

我读here并取得了一切权利,包括 READ_GSERVICES 这是不是在谷歌的说明中规定的这里

I've read the comments from here and have made everything right, including the permissions for READ_GSERVICES which wasn't stated in Google's instructions here

不过我还是有误差

E /谷歌地图Android的API(12334):无法加载地图。不能   与谷歌的服务器。

E/Google Maps Android API(12334): Failed to load map. Could not contact Google servers.

能否无论如何开导我,如果我还有什么遗漏了?

Can anyhow enlighten me if I still have something left out?

我已经包括了这个问题,以及:

I've included this as well:

<permission
      android:name="com.example.permission.MAPS_RECEIVE"
      android:protectionLevel="signature"/>
    <uses-permission android:name="com.example.permission.MAPS_RECEIVE"/>

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

在我的applcation标签。

in my applcation tag.

更新:刚刚成功地删除错误,realied我输入我的READ_GSERVICES错误

UPDATE: Just Managed to remove that error, realied that I typed my READ_GSERVICES wrongly.

不过,现在我有这个问题:

However, now I'm having this problem:

01-24 16:58:08.628:E /谷歌地图Android的API(28025):授权   失败的。

01-24 16:58:08.628: E/Google Maps Android API(28025): Authorization failure.

是什么原因造成这个问题?我SHA1是从我释放证书获得,是错了吗?

What is causing this problem? my SHA1 is obtained from my release cert, is that wrong?

推荐答案

下面是另一回事注意:我注册了相同的SHA1哈希值有两个不同的API项目。 (是的,我知道这是愚蠢的,但我尝试用不同的方法来解决问题。)

Here's another thing to watch out for: I registered the same SHA1 hash with two different API projects. (Yes, I know this is silly, but I was experimenting with different ways to fix a problem.)

我提到这一点在这里,因为你可能有正确配置一切,但你有一个以上的关键就谷歌API控制台项目。 (这里的希望这个愚蠢的错误不会发生在你身上。)

I mention this here, because you may have everything properly configured but you have MORE THAN ONE key for your project on Google's API console. (Here's hoping this silly mistake doesn't happen to you.)