嘿,我想,即使我已經安裝了谷歌Play服務庫,當我運行該應用在我的仿真器使用谷歌地圖,它說谷歌同時使用谷歌地圖API V2 Play服務在Android 2.2或4.1.2模擬器
上的logcat我得到關於它的警告,但不知道爲什麼我收到此
「沒有谷歌播放的是從你的手機丟失服務這個應用程序將無法運行」。
我MainActivity.java
package com.mapsmaps;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GoogleMap mapa = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
activity_main.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=".MainActivity" >
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>
AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mapsmaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="8" />
<permission
android:name="com.mapsmaps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.mapsmaps.permission.MAPS_RECEIVE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />F
<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="com.mapsmaps.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="AIzaSyBdbj4iXi0SijKjJDrJw5RigtSpQcaID7Q" />
</application>
logcat的
01-31 11:10:41.404: D/dalvikvm(451): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
11月1日至31日:10:41.404:W/dalvikvm(451):VFY:無法解決實例字段24 11月1日至31日:10:41.404:d/dalvikvm(451 ):VFY:10:41.404:在0×0012 11月1日至31日更換操作碼0×52 d/dalvikvm(451):VFY:在LCOM /谷歌/機器人/克/普通/死GooglePlayServicesUtil代碼0x0014-0018; .B(Landroid/content/res/Resources;)Z 01-31 11:10:41.443:W/GooglePlayServicesUtil(451):Google Play服務丟失。 01-31 11:10:41.454:W/GooglePlayServicesUtil(451):Google Play服務丟失。 01-31 11:10:41.464:W/GooglePlayServicesUtil(451):Google Play服務丟失。 01-31 11:10:41.464:W/GooglePlayServicesUtil(451):Google Play服務丟失。 01-31 11:10:41.475:W/GooglePlayServicesUtil(451):Google Play服務丟失。 01-31 11:10:41.494:W/GooglePlayServicesUtil(451):Google Play服務丟失。 01-31 11:10:41.504:W/GooglePlayServicesUtil(451):Google Play服務丟失。