我正在尝试在我的设备(Android)上显示地图。我想我已经做对了所有事情,并为清单添加了权限,但是执行它时说应用程序已意外停止。请再试一次。
清单文件详细信息
<uses-permission android:name="android.permission.INTERNET"/>
<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"/>
<permission android:name="com.maps.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.maps.permission.MAPS_RECEIVE"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyD5oEA4Ct8_q_Ic-YBVjSv0_ANMfatvysY"/>
日志猫
05-16 20:19:43.433: W/dalvikvm(303): VFY: unable to resolve static field 872 (MapAttrs) in Lcom/google/android/gms/R$styleable;
05-16 20:19:43.433: D/dalvikvm(303): VFY: replacing opcode 0x62 at 0x000e
05-16 20:19:43.442: D/dalvikvm(303): VFY: dead code 0x0010-00ae in Lcom/google/android/gms/maps/GoogleMapOptions;.createFromAttributes (Landroid/content/Context;Landroid/util/AttributeSet;)Lcom/google/android/gms/maps/GoogleMapOptions;
05-16 20:19:43.452: D/AndroidRuntime(303): Shutting down VM
05-16 20:19:43.452: W/dalvikvm(303): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-16 20:19:43.482: E/AndroidRuntime(303): FATAL EXCEPTION: main
05-16 20:19:43.482: E/AndroidRuntime(303): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
05-16 20:19:43.482: E/AndroidRuntime(303): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
05-16 20:19:43.482: E/AndroidRuntime(303): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-16 20:19:43.482: E/AndroidRuntime(303): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.app.Activity.setContentView(Activity.java:1647)
05-16 20:19:43.482: E/AndroidRuntime(303): at com.example.mymap.Map.onCreate(Map.java:21)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.os.Looper.loop(Looper.java:123)
05-16 20:19:43.482: E/AndroidRuntime(303): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-16 20:19:43.482: E/AndroidRuntime(303): at java.lang.reflect.Method.invokeNative(Native Method)
05-16 20:19:43.482: E/AndroidRuntime(303): at java.lang.reflect.Method.invoke(Method.java:521)
05-16 20:19:43.482: E/AndroidRuntime(303): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-16 20:19:43.482: E/AndroidRuntime(303): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-16 20:19:43.482: E/AndroidRuntime(303): at dalvik.system.NativeStart.main(Native Method)
05-16 20:24:43.612: I/Process(303): Sending signal. PID: 303 SIG: 9