【问题标题】:Runtime error while consuming web service from android从android使用Web服务时出现运行时错误
【发布时间】:2012-05-21 15:11:56
【问题描述】:

我将根据此链接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)

伙计们,据我所知,我已经用谷歌搜索了这些问题,但仍在寻找解决方案。如果有,请告诉我解决方案。

感谢您的宝贵时间!

【问题讨论】:

    标签: android eclipse web-services consuming


    【解决方案1】:

    VM 无法找到类 org.ksoap2.serialization.SoapObject

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

    【讨论】:

    • 你能告诉我如何做VM来定位类org.ksoap2.serialization.SoapObject.Please
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-17
    • 1970-01-01
    • 2020-12-18
    • 2017-11-22
    相关资源
    最近更新 更多