如果没有手机中遗漏的Google Play服务,此应用将无法运行

时间:2013-04-01 14:30:12

标签: android google-maps google-maps-android-api-2 android-2.2-froyo

也许这个问题已被问过数百万次了,但没有什么可以帮助我。

java活动

package com.williamroma.example;

import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class MainActivity extends FragmentActivity {
    @Override
    protected void onCreate(Bundle arg0) {
        // TODO Auto-generated method stub
        super.onCreate(arg0);
        setContentView(R.layout.main);
        GooglePlayServicesUtil
                .isGooglePlayServicesAvailable(getApplicationContext());
        GoogleMap map = ((SupportMapFragment)  getSupportFragmentManager().findFragmentById(R.id.map))
                   .getMap();
    }
}

java mainfest

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

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

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <permission
        android:name="com.williamroma.example.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.williamroma.example.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <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" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".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>

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyCyk2MVC5Fyl7HIB3iHlPgyRqvOF-VXYJw" />
    </application>

</manifest>

项目

enter image description here

模拟器2.2

enter image description here

哪里错了?我已经从sdk安装了google play服务并导入它,然后从project-&gt; property-&gt; android-&gt; add中添加它。

我有成功google-map android v2的密钥

请帮助

0 个答案:

没有答案