简体   繁体   English

无法加载地图。 无法联系Google服务器

[英]Failed to load map. Could not contact Google servers

I got the SHA 1 certificate from the debug keystore . 我从调试密钥库中获得了SHA 1证书

Using that I generated the Google Map V2 Api key . 使用它,我生成了Google Map V2 Api密钥

I extended Fragment Activity. 我扩展了片段活动。

I used "com.google.android.gms.maps.SupportMapFragment" in my xml. 我在xml中使用了“ com.google.android.gms.maps.SupportMapFragment”。

When I run this , it shows the following errors. 当我运行this时,它显示以下错误。 "Failed to load map. Could not contact Google servers" Authorization failed. “无法加载地图。无法联系Google服务器”授权失败。

Can anybody help me to recover from this issue. 谁能帮助我从这个问题中恢复过来。

Manifest 表现

<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
       package="com.example.demomap" 
       android:versionCode="1" 
       android:versionName="1.0" >
    <uses-sdk android:minSdkVersion="8"
        android:targetSdkVersion="15" />
    <permission
         android:name="com.example.demomap.permission.MAPS_RECEIVE"
         android:protectionLevel="signature" />
    <uses-permission android:name="com.example.demomap.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

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

        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

xml code: xml代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/header"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/hello_world"
        tools:context=".MainActivity" />

    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_below="@id/header"
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:name="com.google.android.gms.maps.SupportMapFragment"/>

</RelativeLayout>

java code: Java代码:

    package com.example.demomap;
    import com.google.android.gms.maps.SupportMapFragment;
    import android.os.Bundle;
    import android.app.Activity;
    import android.support.v4.app.FragmentActivity;
    import android.view.Menu;
    public class MainActivity extends FragmentActivity {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    }

On Google Api Console you need to go to services tab and ON Google Map Android API v2 . 在Google Api Console上,您需要转到服务标签,然后在Google Map Android API v2上。 have you done it ? 你做完了吗 ?

Failed to load map. 无法加载地图。 Error contacting Google servers issue with android google maps api v2 if you are getting this message with release api key - it means it is in debug mode. 如果您收到带有发布api密钥的消息,则与Android google google maps api v2的Google服务器联系时发生错误,这意味着它处于调试模式。 So export your app from eclipse and install the app. 因此,请从eclipse中导出您的应用并安装该应用。

It turns out that Google Play Console is probably signing your uploaded app with its own certificate and creating another SHA1 fingerprint different to the one you use for enable your API Map. 事实证明,Google Play控制台可能正在使用自己的证书对您上传的应用进行签名,并创建与用于启用API映射的指纹不同的另一SHA1指纹。 Use the one that you can find in your Google Play Console>Release Management>App Signing setting up that one in your Google Developer Console 使用您可以在Google Play控制台>版本管理>应用签名中找到的那一项,在Google Developer Console中设置该那一项 在此处输入图片说明

暂无
暂无

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

相关问题 “无法加载地图。 无法联系Google服务器。“ - “Failed to load map. Could not contact Google servers.” 修复无法加载地图。 无法联系Google服务器。 - Fix the Failed to load map. Could not contact Google servers. Android地图:无法加载地图。 无法联系Google服务器 - Android Maps: Failed to load map. Could not contact Google servers 无法加载地图。 无法联系Google服务器 - Failed to load map. Could not contact Google servers 授权失败。 无法加载地图。 无法联系Google服务器。 (适用于Android的Google Map) - Authorization failed. Failed to load map. Could not contact Google servers. (Google Map for Android) Google Maps android中的错误“android无法加载地图。 无法联系Google服务器。“ - Error in Google Maps android “android Failed to load map. Could not contact Google servers.” Google Maps Android API v2:无法加载地图。 无法与Google服务器联系 - Google Maps Android 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' Android版Google地图。 无法加载地图。 无法联系Google服务器 - Google Maps for Android. 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
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM