仍然得到"不能获得连接工厂客户端和QUOT;错误 [英] Still Gets "Couldn't get connection factory client" Error

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

问题描述

10月4日至1号:17:20.701:E / MapActivity(377):不能获得连接工厂客户端

我得到的是灰瓦,地图没有得到加载不。

嘿大家,我知道有很多类似的帖子我也完全通过他们去的。

这可以是Internet的权限(我补充说,以前的应用程序标记),或

使用库机器人:名称=com.google.android.maps(由内部应用程序标记)或

这是坏的API密钥。

下面是我之前创建一个调试键和谷歌地图API V1显示正确的地图,没有问题的东西。 后来,当我打开该项目并没有解决MapActivity,GeoPoint对象,MapController等。

所以我创建了我使用的是现在在这个项目上的另一个调试的关键,我仔细检查了我所有的步骤正确地创建API时。

难道这(我创建一个新的调试过大)造成这个问题?我应该删除debug.keystore在C:\用户\ abc.android和项目来自动创建一个新的调试?会是解决问题还是会导致我更多的问题?

我一直在寻找,因为昨天我仍然有问题,请帮助me.Thank你这么多提前如果有的话code是必要的,让我知道我会后他们的解决方案。

MActivity.java

 包com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC;

进口com.google.android.maps.GeoPoint;
进口com.google.android.maps.MapActivity;
进口com.google.android.maps.MapController;
进口com.google.android.maps.MapView;


进口android.os.Bundle;

公共类MActivity扩展MapActivity {


    MapController mControl;
    的GeoPoint GeoP;
    图形页面mapV;

    @覆盖
    保护无效的onCreate(包savedInstanceState){
        // TODO自动生成方法存根
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.map);

        mapV =(图形页面)findViewById(R.id.mapView);
        mapV.displayZoomControls(真正的);
        mapV.setBuiltInZoomControls(真正的);

        双纬度= 6.796396;
        双隆基= 79.877823;

        mControl = mapV.getController();

        GeoP =新的GeoPoint((INT)(LAT * 1E6),(INT)(隆基* 1E6));
        mControl.animateTo(GeoP);
        mControl.setZoom(13);


    }

    @覆盖
    保护的布尔isRouteDisplayed(){
        // TODO自动生成方法存根
        返回false;
    }

}
 


map.xml

 < XML版本=1.0编码=UTF-8&GT?;
< RelativeLayout的的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    机器人:背景=@色/ layoutbg
    机器人:方向=垂直>

   < com.google.android.maps.MapView
        机器人:ID =@ + ID /图形页面
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =FILL_PARENT
        机器人:apiKey =AIzaSyCy32DkrrrrT,UBhoT8xiAW182qUaAqi3s
        机器人:启用=真
        机器人:可点击=真/>

< / RelativeLayout的>
 


清单

 < XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC
    安卓版code =1
    机器人:VERSIONNAME =1.0>

    <用途-SDK
        安卓的minSdkVersion =10
        机器人:targetSdkVersion =17/>


     <许可
          机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.permission.MAPS_RECEIVE
          安卓的ProtectionLevel =签名/>
        <使用-权限的Andr​​oid:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.permission.MAPS_RECEIVE/>


    <使用-权限的Andr​​oid:名称=android.permission.INTERNET对/>

    <使用-权限的Andr​​oid:名称=android.permission.ACCESS_NETWORK_STATE/>
    <使用-权限的Andr​​oid:名称=android.permission.WRITE_EXTERNAL_STORAG​​E/>
    <使用-权限的Andr​​oid:名称=com.google.android.providers.gsf.permission.READ_GSERVICES/>

    <使用-权限的Andr​​oid:名称=android.permission.ACCESS_COARSE_LOCATION/>
    <使用-权限的Andr​​oid:名称=android.permission.ACCESS_FINE_LOCATION/>

    <用途特征
        机器人:glEsVersion =0x00020000
        机器人:要求=真/>



    <应用
        机器人:allowBackup =真
        机器人:图标=@可绘制/ ic_launcher
        机器人:标签=@字符串/ APP_NAME
        机器人:主题=@风格/ AppTheme>

        <使用库机器人:名称=com.google.android.maps/>


        <活动
            机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MainActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=android.intent.action.MAIN/>

                <类机器人:名称=android.intent.category.LAUNCHER/>
            &所述; /意图滤光器>
        < /活性GT;


        <活动
            机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MenuActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.KCLOGO/>

                <类机器人:名称=android.intent.category.DEFAULT/>
            &所述; /意图滤光器>
        < /活性GT;


        <活动
            机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.AddFromContactsActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.ADDFROMCONTACT/>

                <类机器人:名称=android.intent.category.DEFAULT/>
            &所述; /意图滤光器>
        < /活性GT;


        <活动
            机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.MAPS/>

                <类机器人:名称=android.intent.category.DEFAULT/>
            &所述; /意图滤光器>
        < /活性GT;


        <活动
            机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.LoginActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.LOGIN/>

                <类机器人:名称=android.intent.category.DEFAULT/>
            &所述; /意图滤光器>
        < /活性GT;


        <活动
            机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.SignupActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.SIGNUP/>

                <类机器人:名称=android.intent.category.DEFAULT/>
            &所述; /意图滤光器>
        < /活性GT;


        <活动
            机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.AddToContactsActivity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=com.Aws0mEKCkreaTi0ns.GlobAlpSystracKerKC.ADDTOCONTACTS/>

                <类机器人:名称=android.intent.category.DEFAULT/>
            &所述; /意图滤光器>
        < /活性GT;

        &所述;元数据
        机器人:名称=com.google.android.maps.v2.API_KEY
        机器人:值=AIzaSyCy32DkrrrrT-UBhoT8xiAW182qUaAqi3s/>

    < /用途>



< /舱单>
 

解决方案

我想你已经混了一些V1和V2功能(如使用<使用库机器人:名称=com.google .android.maps/> 的清单和使用的GeoPoint 等。(https://groups.google.com/forum/?fromgroups=#!topic/android-developers/CGF5X1HMLuY)

试着用下面的示例code:

MActivity.java

 公共类MActivity扩展FragmentActivity {

私人GoogleMap的地图;
    @覆盖
    保护无效的onCreate(包savedInstanceState){
        // TODO自动生成方法存根
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.activity_map);

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

        双纬度= 6.796396;
        双隆基= 79.877823;
        最后的经纬度HAMBURG =新的经纬度(LAT,隆基);
        标记汉堡= map.addMarker(新MarkerOptions()。位置(汉堡)
                .title伪(汉堡));
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(汉堡,15));


    }
 

Map.xml

 < RelativeLayout的的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
的xmlns:工具=htt​​p://schemas.android.com/tool​​s
机器人:layout_width =match_parent
机器人:layout_height =match_parent
工具:上下文=MapsActivity。>

<片段
    机器人:ID =@ + ID /图
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    类=com.google.android.gms.maps.SupportMapFragment/>
  < / RelativeLayout的>
 

删除<使用库机器人:名称=com.google.android.maps/> 从清单。

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.

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

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

it's bad API Key.

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..

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.

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

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

<?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>

解决方案

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)

Try with the sample code below :

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>

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

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

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