我需要在物理 Android 设备上运行地图,我该怎么做?
我不想使用 AVD 来调试它。
顺便说一句,我在 AVD 上遇到了同样的错误,所以请帮忙?这是我的代码
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:apiKey="0enZtoViiB7JtEUxmyjwYWuw0Hz8pdTqNNWtBjQ"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true" />
AndroidManifest.xml
<uses-library android:name="com.google.android.maps" />
活动:
public class AroundMeActivity extends MapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.qa_layout_activity);
MapView mapView = (MapView) findViewById(R.id.map);
mapView.setBuiltInZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
STACKTRACE:
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
at dalvik.system.DexFile.defineClass(Native Method)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:207)
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:200)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)