我需要使用地圖上運行的物理Android設備, 我該怎麼做?如何在物理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)
您是否在清單中使用Google API版本? – BDFun
我不知道你的意思? – IamStalker