嘿,我正在尝试在我的模拟器上使用谷歌地图,即使我在运行它说的应用程序时已经安装了谷歌播放服务库
“如果没有手机中缺少的 google play 服务,此应用将无法运行”</p>
在 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>
日志猫
01-31 11:10:41.404: D/dalvikvm(451): DexOpt: couldn't find field Landroid/content/res/Configuration;.smallestScreenWidthDp
01-31 11:10:41.404: W/dalvikvm(451): VFY: 无法解析实例字段 24 01-31 11:10:41.404: D/dalvikvm(451): VFY: 在 0x0012 01-31 替换操作码 0x52 11:10:41.404: D/dalvikvm(451): VFY: Lcom/google/android/gms/common/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: