本文介绍了除了在使用Android版ksoap2库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Ksoap2版本2.5.4在我的Maven启用的Android项目。凡提述本KSOAP特定的类抛出此异常
I'm using Ksoap2 version 2.5.4 in my maven enabled android Project. Any reference to the Ksoap specific classes is throwing this exception
04-18 20:35:15.429: ERROR/dalvikvm(626): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.rare.Main.fetchSoapResponse
04-18 20:35:15.662: ERROR/AndroidRuntime(626): FATAL EXCEPTION: main
04-18 20:35:15.662: ERROR/AndroidRuntime(626): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at com.rare.Main.fetchSoapResponse(Main.java:57)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at com.rare.Main.onCreate(Main.java:23)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.os.Handler.dispatchMessage(Handler.java:99)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.os.Looper.loop(Looper.java:123)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at java.lang.reflect.Method.invokeNative(Native Method)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at java.lang.reflect.Method.invoke(Method.java:507)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-18 20:35:15.662: ERROR/AndroidRuntime(626): at dalvik.system.NativeStart.main(Native Method)
的code线引起,这是
the line of code causing this is
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
找不到与此相关的SO或其他论坛的任何帮助。这似乎是pretty的直线前进。任何人能告诉我什么失踪,我怎么可以让Android应用在运行时库。
Couldn't find any help related to this on SO or other forums. This seems pretty straight forward. Can any one tell me whats missing and how I can make android use the library at run time.
推荐答案
- 在您的构建路径清除所有的库(JAR文件)。
- 在项目的主目录下创建一个文件夹,并把它命名为库(不LIB)。
- 现在,Eclipse的ADT插件会增加您的jar文件到构建路径。
- 在清洁和放大器;建立你的项目,如果有必要的。
- 快乐编码
- In your build path clear all libraries (jar files).
- In project's main directory create a folder and named it "libs" (not"lib").
- Now Eclipse ADT Plugin will add your jar files to build path.
- Clean & Build your project if necessary.
- Happy coding
这篇关于除了在使用Android版ksoap2库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!