我正在开发一款显示Google地图的Android应用。我的日志猫显示以下错误。我是android开发的新手。请帮帮我。感谢
03-06 06:31:25.561: E/dalvikvm(2476): Could not find class 'com.example.mapdemo.BasicMapActivity', referenced from method com.example.mapdemo.MainActivity.<clinit>
03-06 06:31:26.253: E/AndroidRuntime(2476): FATAL EXCEPTION: main
03-06 06:31:26.253: E/AndroidRuntime(2476): java.lang.ExceptionInInitializerError
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.Class.newInstanceImpl(Native Method)
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.Class.newInstance(Class.java:1319)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.os.Handler.dispatchMessage(Handler.java:99)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.os.Looper.loop(Looper.java:137)
03-06 06:31:26.253: E/AndroidRuntime(2476): at android.app.ActivityThread.main(ActivityThread.java:5041)
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.reflect.Method.invokeNative(Native Method)
03-06 06:31:26.253: E/AndroidRuntime(2476): at java.lang.reflect.Method.invoke(Method.java:511)
03-06 06:31:26.253: E/AndroidRuntime(2476): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-06 06:31:26.253: E/AndroidRuntime(2476): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-06 06:31:26.253: E/AndroidRuntime(2476): at dalvik.system.NativeStart.main(Native Method)
03-06 06:31:26.253: E/AndroidRuntime(2476): Caused by: java.lang.NoClassDefFoundError: com.example.mapdemo.BasicMapActivity
03-06 06:31:26.253: E/AndroidRuntime(2476): at com.example.mapdemo.MainActivity.<clinit>(MainActivity.java:98)
03-06 06:31:26.253: E/AndroidRuntime(2476): ... 15 more
答案 0 :(得分:0)
您应该在清单中的应用标记中包含此<uses-library android:name="com.google.android.maps" />
,并且还要包含此权限
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
答案 1 :(得分:0)