简体   繁体   English

错误:Android MapActivity:无法获取连接工厂客户端

[英]Error: Android MapActivity : Couldn't get connection factory client

I have the same error: I find that the application launches and there is a gray grid display and no map. 我有同样的错误:我发现该应用程序启动,并且显示灰色网格,没有地图。 The error in Logcat is: Android MapActivity : Couldn't get connection factory client Please find the xml, manifest and java files below: Logcat中的错误是:Android MapActivity:无法获得连接工厂客户端请在下面找到xml,清单和java文件:

My Manifest file is: 我的清单文件是:

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

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

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

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

        <activity
            android:name=".Main"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

My XML file is: main.xml 我的XML文件是:main.xml

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:apiKey="0A8yftT7fCdjnsszwITqiWCc7xwH9hxSoXC44Ag"
    android:clickable="true" />

My Java File is also pretty spot on. 我的Java文件也很不错。

package maps.google;

import android.os.Bundle;
import android.view.MotionEvent;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;

public class Main extends MapActivity {
    MapView map;
        long start, stop;

        @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        map = (MapView) findViewById(R.id.mapview);
    }

    class Touchy extends Overlay {
        public boolean onTouchEvent(MotionEvent e, MapView m) {

            return false;
        }
    }

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

In command prompt set your jdk path like below::: 在命令提示符下,设置您的jdk路径,如下所示:::

Step1:: C:/program files/java/jdk6/bin>

Step2:: C:/program files/java/jdk6/bin>keytool -v -list -alias androiddebugkey -keystore "C:\Users\Agarwal\.android\debug.keystore"

Step3:: enter password android

Step4:: copy MD5 Figerprint and [click here][1]

Step5:: Copy the APIKEY and paste it in your xml file.

Note:: In Step2 just change the path of your debug.keystore. 注意:在Step2中,只需更改debug.keystore的路径即可。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM