1

大家好,我正在开发一个应用程序,它将所有事件从谷歌日历下载到安卓设备。我找到了这个例子: http ://code.google.com/p/google-api-java-client/source/browse/calendar-android-sample/?repo=samples

我还从http://code.google.com/p/google-api-java-client/wiki/APIs下载了所需的库 也从这里:“http://code.google.com/p/google-api -java-客户端/下载/列表"

但是我收到错误,因为找不到类定义。请帮我。我的Logcat如下:

***10-10 12:52:10.129: E/dalvikvm(551): Could not find class 'com.google.api.services.calendar.Calendar$Builder', referenced from method com.examples.gcalsync.CalendarSample.onCreate***
10-10 12:52:10.129: W/dalvikvm(551): VFY: unable to resolve new-instance 702 (Lcom/google/api/services/calendar/Calendar$Builder;) in Lcom/examples/gcalsync/CalendarSample;
10-10 12:52:10.129: D/dalvikvm(551): VFY: replacing opcode 0x22 at 0x0009
10-10 12:52:10.129: D/dalvikvm(551): VFY: dead code 0x000b-0060 in Lcom/examples/gcalsync/CalendarSample;.onCreate (Landroid/os/Bundle;)V
10-10 12:52:10.139: E/dalvikvm(551): Could not find class 'com.google.api.services.calendar.model.Calendar', referenced from method com.examples.gcalsync.CalendarSample.onOptionsItemSelected
10-10 12:52:10.139: W/dalvikvm(551): VFY: unable to resolve new-instance 710 (Lcom/google/api/services/calendar/model/Calendar;) in Lcom/examples/gcalsync/CalendarSample;
10-10 12:52:10.139: D/dalvikvm(551): VFY: replacing opcode 0x22 at 0x000b
10-10 12:52:10.139: D/dalvikvm(551): VFY: dead code 0x000d-0036 in Lcom/examples/gcalsync/CalendarSample;.onOptionsItemSelected (Landroid/view/MenuItem;)Z
10-10 12:52:10.179: D/AndroidRuntime(551): Shutting down VM
10-10 12:52:10.179: W/dalvikvm(551): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-10 12:52:10.199: E/AndroidRuntime(551): FATAL EXCEPTION: main
***10-10 12:52:10.199: E/AndroidRuntime(551): java.lang.NoClassDefFoundError: com.google.api.services.calendar.Calendar$Builder***
10-10 12:52:10.199: E/AndroidRuntime(551):  at com.examples.gcalsync.CalendarSample.onCreate(CalendarSample.java:127)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.os.Looper.loop(Looper.java:123)
10-10 12:52:10.199: E/AndroidRuntime(551):  at android.app.ActivityThread.main(ActivityThread.java:4627)
10-10 12:52:10.199: E/AndroidRuntime(551):  at java.lang.reflect.Method.invokeNative(Native Method)
10-10 12:52:10.199: E/AndroidRuntime(551):  at java.lang.reflect.Method.invoke(Method.java:521)
10-10 12:52:10.199: E/AndroidRuntime(551):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-10 12:52:10.199: E/AndroidRuntime(551):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-10 12:52:10.199: E/AndroidRuntime(551):  at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

-1

问题得到解决。只需要将所有外部库放在 libs 文件夹中......

于 2012-10-15T07:58:32.970 回答