【问题标题】:Android google maps get error Couldn't get connection factory clientAndroid 谷歌地图获取错误无法获取连接工厂客户端
【发布时间】:2013-01-21 14:41:01
【问题描述】:

Android google maps 出错无法获取连接工厂客户端,我已经从here 获取 apikey,这是我的代码:

MainActivity.java

package com.haichal.map;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;

public class MainActivity extends MapActivity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }
}

main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="0IbdGeqd17e6zbTdNfSze2pEt1jJzEEPoOM0jZw"
        />

</RelativeLayout>

清单

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.haichal.map"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="4"
        android:targetSdkVersion="15" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <uses-library android:name="com.google.android.maps" />

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

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

在android项目目标中,我使用Google API,平台4.1.2,Api级别16

在我的 Eclipse 项目中没有出现错误(没有红色气球),我调试并安装成功,但是当我运行应用程序时,地图只是得到空白网格,没有得到地图,如果我查看日志 cat 我得到消息错误 无法获取连接工厂客户端

如何解决我的问题?

【问题讨论】:

    标签: android google-maps


    【解决方案1】:

    当我运行应用程序时,地图只是得到空白网格,而不是地图

    您的设备无法访问互联网(至少无法访问 Google 地图服务器),或者您的 API 密钥错误。另一种可能性是您缺少INTERNET 权限,但您似乎已经拥有该权限。

    如果我查看日志 cat 我收到消息错误无法获取连接工厂客户端

    即使您的应用正常运行,该消息也会一直出现。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-13
      • 2013-09-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多