从Android使用Web服务时运行时错误

时间:2012-05-14 06:07:43

标签: android eclipse web-services consuming

我将根据此链接http://jatin4rise.wordpress.com/2010/10/03/webservicecallfromandroid/从android使用Web服务但在运行时我的android应用程序[AndroidFrontend]显示为

抱歉! 应用程序AndroidFrontend(process.org.web.android.frontend)意外停止。请稍后再试。

logcat显示为

logcat的

05-14 11:13:55.133: E/dalvikvm(208): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method org.web.android.frontend.AndroidFrontendActivity.onCreate
05-14 11:13:55.133: W/dalvikvm(208): VFY: unable to resolve new-instance 25 (Lorg/ksoap2/serialization/SoapObject;) in Lorg/web/android/frontend/AndroidFrontendActivity;
05-14 11:13:55.133: D/dalvikvm(208): VFY: replacing opcode 0x22 at 0x0010
05-14 11:13:55.163: D/dalvikvm(208): VFY: dead code 0x0012-0081 in Lorg/web/android/frontend/AndroidFrontendActivity;.onCreate (Landroid/os/Bundle;)V
05-14 11:13:55.224: D/AndroidRuntime(208): Shutting down VM
05-14 11:13:55.224: W/dalvikvm(208): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-14 11:13:55.233: E/AndroidRuntime(208): FATAL EXCEPTION: main
05-14 11:13:55.233: E/AndroidRuntime(208): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
05-14 11:13:55.233: E/AndroidRuntime(208):  at org.web.android.frontend.AndroidFrontendActivity.onCreate(AndroidFrontendActivity.java:28)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.os.Looper.loop(Looper.java:123)
05-14 11:13:55.233: E/AndroidRuntime(208):  at android.app.ActivityThread.main(ActivityThread.java:4627)
05-14 11:13:55.233: E/AndroidRuntime(208):  at java.lang.reflect.Method.invokeNative(Native Method)
05-14 11:13:55.233: E/AndroidRuntime(208):  at java.lang.reflect.Method.invoke(Method.java:521)
05-14 11:13:55.233: E/AndroidRuntime(208):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-14 11:13:55.233: E/AndroidRuntime(208):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-14 11:13:55.233: E/AndroidRuntime(208):  at dalvik.system.NativeStart.main(Native Method)

伙计们,我根据我的知识搜索了这些问题,但仍在寻求解决方案。如果有的话,请让我知道解决方案。

感谢宝贵的时间!

1 个答案:

答案 0 :(得分:2)

VM无法找到班级org.ksoap2.serialization.SoapObject

确保在构建项目时包含所需的库(JAR文件)。