我下载了谷歌地图 api v2 示例并按照谷歌网站上的官方教程(安装并添加了谷歌播放服务)但运行示例时出现 NoClassDefFoundError 错误,如下所示
07-26 02:01:04.821: I/Process(620): Sending signal. PID: 620 SIG: 9
07-26 02:01:18.559: W/dalvikvm(682): Unable to resolve superclass of Lcom/example/mapdemo/BasicMapActivity; (80)
07-26 02:01:18.559: W/dalvikvm(682): Link of class 'Lcom/example/mapdemo/BasicMapActivity;' failed
07-26 02:01:18.559: E/dalvikvm(682): Could not find class 'com.example.mapdemo.BasicMapActivity', referenced from method com.example.mapdemo.MainActivity.<clinit>
07-26 02:01:18.559: W/dalvikvm(682): VFY: unable to resolve const-class 128 (Lcom/example/mapdemo/BasicMapActivity;) in Lcom/example/mapdemo/MainActivity;
07-26 02:01:18.559: D/dalvikvm(682): VFY: replacing opcode 0x1c at 0x000d
07-26 02:01:18.658: W/dalvikvm(682): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/example/mapdemo/MainActivity;
07-26 02:01:18.658: W/dalvikvm(682): Class init failed in newInstance call (Lcom/example/mapdemo/MainActivity;)
07-26 02:01:18.676: D/AndroidRuntime(682): Shutting down VM
07-26 02:01:18.676: W/dalvikvm(682): threadid=1: thread exiting with uncaught exception (group=0x40014760)
07-26 02:01:18.791: E/AndroidRuntime(682): FATAL EXCEPTION: main
07-26 02:01:18.791: E/AndroidRuntime(682): java.lang.ExceptionInInitializerError
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.Class.newInstanceImpl(Native Method)
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.Class.newInstance(Class.java:1301)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1663)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1764)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.os.Looper.loop(Looper.java:132)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.main(ActivityThread.java:4025)
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.reflect.Method.invoke(Method.java:491)
07-26 02:01:18.791: E/AndroidRuntime(682): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
07-26 02:01:18.791: E/AndroidRuntime(682): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
07-26 02:01:18.791: E/AndroidRuntime(682): at dalvik.system.NativeStart.main(Native Method)
07-26 02:01:18.791: E/AndroidRuntime(682): Caused by: java.lang.NoClassDefFoundError: com.example.mapdemo.BasicMapActivity
07-26 02:01:18.791: E/AndroidRuntime(682): at com.example.mapdemo.MainActivity.<clinit>(MainActivity.java:100)
07-26 02:01:18.791: E/AndroidRuntime(682): ... 15 more
07-26 02:06:18.960: I/Process(682): Sending signal. PID: 682 SIG: 9
我通过将“窗口>首选项> Android>构建> SHA 1指纹”中的SHA 1指纹与谷歌示例包名称“com.example.mapdemo”结合起来获得谷歌api密钥
请帮助我,对不起我的英语,非常感谢。
我更改了目标 sdk 和模拟器是 4.0,那个错误消失了,但我得到了一个新的是“谷歌播放服务是任务”。
然后,我更改了目标 sdk 和模拟器是 4.2.2,我收到错误“谷歌播放服务已过期。需要 3159100 但找到 3136130”
请帮我。