仍然获得“无法获得连接工厂客户端"错误 [英] Still Gets "Couldn't get connection factory client" Error

查看:57
本文介绍了仍然获得“无法获得连接工厂客户端"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

04-01 10:17:20.701:E/MapActivity(377):无法获得连接工厂客户端

04-01 10:17:20.701: E/MapActivity(377): Couldn't get connection factory client

我得到的只是灰色瓷砖,并且地图没有加载.

All I get is gray tiles and the map doesn't get loaded.

嘿,我知道的每个人都有很多我做过的类似文章.

Hey everyone I know there are lots of similar posts I did thoroughly go through them.

可以是Internet权限(我在应用程序标签之前添加了该权限),或者

It can be Internet permission (I added that before application tag ), Or

uses-library android:name ="com.google.android.maps"(添加在应用程序标记中)或

uses-library android:name="com.google.android.maps" (Added inside application tag ) or

这是错误的API密钥.

it's bad API Key.

这是我之前创建的调试键,Google map api v1可以正确显示地图,没有任何问题. 后来,当我打开该项目时,它没有解析MapActivity,GeoPoint,MapController等.

Here's the thing I earlier created a debug key and Google map api v1 displayed map correctly with no problem. Later when i opened that project it didn't resolve MapActivity,GeoPoint,MapController etc..

所以我创建了另一个调试密钥,该项目现在正在使用该调试密钥,并仔细检查了在创建api时是否正确执行了所有步骤.

so I created another debug key which I'm using now on this project and I double checked I followed all the steps correctly when creating api.

这是(我在旧的基础上创建新的调试程序)引起此问题吗?我应该删除C:\ Users \ abc.android中的debug.keystore并调试项目以自动创建新项目吗?它会解决问题还是会导致我遇到更多问题?

Is this(me creating a new debug over old) causing this problem? Should I delete the debug.keystore in C:\Users\abc.android and debug the project to automatically create a new? would it solve the problem or will it lead me to more problems?

从昨天开始我一直在寻找解决方案,但是我仍然有问题,请帮帮我.如果需要任何代码,请在此先多谢,让我知道我会发布它们.

I've been searching for a solution since yesterday I still have the problem please help me.Thank you so much in advance if any code is needed let me know I'll post them.

MActivity.java

MActivity.java

package com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;


import android.os.Bundle;

public class MActivity extends MapActivity {


    MapController mControl;
    GeoPoint GeoP;
    MapView mapV;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.map);

        mapV =(MapView)findViewById(R.id.mapView);
        mapV.displayZoomControls(true);
        mapV.setBuiltInZoomControls(true);

        double lat = 6.796396;
        double longi = 79.877823;

        mControl = mapV.getController();

        GeoP = new GeoPoint((int)( lat * 1E6 ),(int)( longi * 1E6 ));
        mControl.animateTo(GeoP);
        mControl.setZoom(13);


    }

    @Override
    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        return false;
    }

}


map.xml


map.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/layoutbg"
    android:orientation="vertical" >

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

</RelativeLayout>


清单


Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="17"/>


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


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

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

    <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:allowBackup="true"
        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="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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


        <activity
            android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MenuActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.KCLOGO" />

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


        <activity
            android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.AddFromContactsActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.ADDFROMCONTACT" />

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


        <activity
            android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MAPS" />

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


        <activity
            android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.LoginActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.LOGIN" />

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


        <activity
            android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.SignupActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.SIGNUP" />

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


        <activity
            android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.AddToContactsActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.ADDTOCONTACTS" />

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

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

    </application>



</manifest>

推荐答案

我想您已经混合了一些V1和V2功能(例如在清单中使用<uses-library android:name="com.google.android.maps" />GeoPoint等)( https://groups.google.com/forum/?fromgroups=# !topic/android-developers/CGF5X1HMLuY )

I guess you have mixed some of V1 and V2 features (like using <uses-library android:name="com.google.android.maps" /> in manifest and use of GeoPoint etc. (https://groups.google.com/forum/?fromgroups=#!topic/android-developers/CGF5X1HMLuY)

尝试下面的示例代码:

MActivity.java

MActivity.java

   public class MActivity extends FragmentActivity{

private GoogleMap map;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_map);

        map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                .getMap();

        double lat = 6.796396;
        double longi = 79.877823;
        final LatLng HAMBURG = new LatLng(lat,longi);
        Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
                .title("Hamburg"));
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));


    }

Map.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"
tools:context=".MapsActivity" >

<fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment" />
  </RelativeLayout>

从清单中删除<uses-library android:name="com.google.android.maps" /> .

Remove <uses-library android:name="com.google.android.maps" /> from manifest.

这篇关于仍然获得“无法获得连接工厂客户端"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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