简体   繁体   English

Google Maps Android API v2:无法加载地图。 无法与Google服务器联系

[英]Google Maps Android API v2: Failed to Load Map. Could not contact Google Servers

I'm trying to use Google Maps Android API v2, and I have already created the SHA1 key from my release cert. 我正在尝试使用Google Maps Android API v2,我已经从我的发布证书中创建了SHA1密钥。

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 我读过从注释在这里 ,并已取得的一切权利,包括权限READ_GSERVICES这是不是在谷歌的说明中规定这里

However I'm still having the error of 但是我仍然有错误

E/Google Maps Android API(12334): Failed to load map. E / Google Maps Android API(12334):无法加载地图。 Could not contact Google servers. 无法联系Google服务器。

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"/>

and

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

in my applcation tag. 在我的applcation标签中。

UPDATE : Just Managed to remove that error, realied that I typed my READ_GSERVICES wrongly. 更新 :刚刚管理删除该错误,认为我错误地键入了我的READ_GSERVICES。

However, now I'm having this problem: 但是,现在我遇到了这个问题:

01-24 16:58:08.628: E/Google Maps Android API(28025): Authorization failure. 01-24 16:58:08.628:E / Google Maps Android API(28025):授权失败。

What is causing this problem? 是什么导致了这个问题? my SHA1 is obtained from my release cert, is that wrong? 我的SHA1是从我的发布证书中获得的,是错的吗?

Did you solve the problem? 你解决了这个问题吗? May be this is the problem -> 可能这是问题 - >

Wrong service was enabled. 启用了错误的服务。 Make sure the "Google Maps Android API v2", not "Google Maps API v2" is enabled and re-generate the API key. 确保已启用“Google Maps Android API v2”,而非“Google Maps API v2”并重新生成API密钥。 ( https://stackoverflow.com/a/13805807/1300982 ) https://stackoverflow.com/a/13805807/1300982

If this is the problem, do not forget to Regenerate the API Key. 如果这是问题,请不要忘记重新生成API密钥。

Here's another thing to watch out for: I registered the same SHA1 hash with two different API projects. 这是另一件要注意的事情:我使用两个不同的API项目注册了相同的SHA1哈希。 (Yes, I know this is silly, but I was experimenting with different ways to fix a problem.) (是的,我知道这很愚蠢,但我正在尝试不同的方法来解决问题。)

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. 我在这里提到这一点,因为您可能已经正确配置了所有内容,但您在Google的API控制台上拥有的项目数量超过一个。 (Here's hoping this silly mistake doesn't happen to you.) (这里希望这个愚蠢的错误不会发生在你身上。)

As this time you are using 这次你正在使用

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

are you sure that you package name is com.example , if not then replace com.example with actual package_name 你确定你的包名是com.example ,如果没有,那么用实际的package_name替换com.example

I had the same problem. 我有同样的问题。 I was using google maps api v1 key. 我正在使用谷歌地图api v1键。 I swithced it with google maps android api v2 key and problem solved. 我用谷歌地图android api v2键解开它,问题解决了。

确保为不同的应用程序生成不同的密钥。

I had the same problem and nothing worked. 我有同样的问题,没有任何效果。 Then I have found Google Play Services in the Application Manager and cleared the data. 然后我在应用程序管理器中找到了Google Play服务并清除了数据。 Suddenly new API key started working! 突然新的API密钥开始工作了!

If you are using Xamarin remember to create the API key using the debug.keystore stored in: 如果您正在使用Xamarin,请记住使用存储在以下位置的debug.keystore创建API密钥:

Windows users: C:\\Users[USERNAME]\\AppData\\Local\\Xamarin\\Mono for Android\\debug.keystore Windows用户:C:\\ Users [USERNAME] \\ AppData \\ Local \\ Xamarin \\ Mono for Android \\ debug.keystore

OSX: Users/[USERNAME]/.local/share/Xamarin/Mono for Android/debug.keystore OSX:用户/ [USERNAME] /。local / share / Xamarin / Mono for Android / debug.keystore

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Maps API V2&#39;无法加载地图。 无法联系Google服务器 - Google Maps API V2 'Failed to Load Map. Could not contact Google Servers' Google Maps API V2&#39;无法加载地图。 即使我检查权限和密钥库也无法联系Google服务器 - Google Maps API V2 'Failed to Load Map. Could not contact Google Servers', Even I check permission and keystore Android地图:无法加载地图。 无法联系Google服务器 - Android Maps: Failed to load map. Could not contact Google servers Google Maps android中的错误“android无法加载地图。 无法联系Google服务器。“ - Error in Google Maps android “android Failed to load map. Could not contact Google servers.” Android版Google地图。 无法加载地图。 无法联系Google服务器 - Google Maps for Android. Failed to load map. Could not contact Google servers Google Maps API v2。 加载地图失败。 无法连接到Google服务器 - Google maps api v2. Failed to Load Map. Could not connect to google servers 授权失败。 无法加载地图。 无法联系Google服务器。 (适用于Android的Google Map) - Authorization failed. Failed to load map. Could not contact Google servers. (Google Map for Android) 无法加载地图。 无法联系Google服务器 - Failed to load map. Could not contact Google servers “无法加载地图。 无法联系Google服务器。“ - “Failed to load map. Could not contact Google servers.” 修复无法加载地图。 无法联系Google服务器。 - Fix the Failed to load map. Could not contact Google servers.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM