在android中启动谷歌地图示例的致命错误

时间:2011-06-13 08:23:03

标签: android google-maps

我正在尝试从以下链接运行示例 commonsguy 但在logcat中获得以下运行时错误

   06-13 13:01:45.513: ERROR/AndroidRuntime(782): FATAL EXCEPTION: main
06-13 13:01:45.513: ERROR/AndroidRuntime(782): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at dalvik.system.DexFile.defineClass(Native Method)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.os.Looper.loop(Looper.java:123)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at android.app.ActivityThread.main(ActivityThread.java:4627)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at java.lang.reflect.Method.invokeNative(Native Method)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at java.lang.reflect.Method.invoke(Method.java:521)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-13 13:01:45.513: ERROR/AndroidRuntime(782):     at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:1)

确保您的清单包含以下行:

<uses-library android:name="com.google.android.maps" />

它必须是应用程序标记的子代。对我来说它有所帮助。