Здесь я даю свой код для просмотра карты Google, это не работает, если я имитирую, придет ошибка Force close,
любое тело помогает мне, я также даю информацию о своем бревне ...
1.gmap класс занятий
package net.gmaps;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class GoogleMapsActivity extends MapActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mv = (MapView) findViewById(R.id.mapView);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
2.main.xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0jEK9Odr895XgKEM5xr-nCr6stwV9dUquFVdsWg"
/>
</RelativeLayout>
3.файл манифеста Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.gmaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:label="@string/app_name"
android:name=".GoogleMapsActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
4.my Logcat подробности
11-30 12:28:45.996: D/AndroidRuntime(306): Shutting down VM
11-30 12:28:45.996: W/dalvikvm(306): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
11-30 12:28:45.996: E/AndroidRuntime(306): Uncaught handler: thread main exiting due to uncaught exception
11-30 12:28:46.035: E/AndroidRuntime(306): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
11-30 12:28:46.035: E/AndroidRuntime(306): at dalvik.system.DexFile.defineClass(Native Method)
11-30 12:28:46.035: E/AndroidRuntime(306): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)
11-30 12:28:46.035: E/AndroidRuntime(306): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
11-30 12:28:46.035: E/AndroidRuntime(306): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
11-30 12:28:46.035: E/AndroidRuntime(306): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.os.Handler.dispatchMessage(Handler.java:99)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.os.Looper.loop(Looper.java:123)
11-30 12:28:46.035: E/AndroidRuntime(306): at android.app.ActivityThread.main(ActivityThread.java:4363)
11-30 12:28:46.035: E/AndroidRuntime(306): at java.lang.reflect.Method.invokeNative(Native Method)
11-30 12:28:46.035: E/AndroidRuntime(306): at java.lang.reflect.Method.invoke(Method.java:521)
11-30 12:28:46.035: E/AndroidRuntime(306): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
11-30 12:28:46.035: E/AndroidRuntime(306): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
11-30 12:28:46.035: E/AndroidRuntime(306): at dalvik.system.NativeStart.main(Native Method)
11-30 12:28:46.085: I/dalvikvm(306): threadid=7: reacting to signal 3
11-30 12:28:46.265: I/dalvikvm(306): Wrote stack trace to '/data/anr/traces.txt'