KSOP2 Librarary class not found exception

北慕城南 提交于 2019-12-01 11:30:41

问题


I've used KSOP2 in my project and it worked all these days. Recently I bought a new machine and moved my project to new machine and imported the ksoap library to project etc etc and when I try to run the application I get following error in the emulator

Caused by: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject

this is the place where exception is thrown.

 SoapObject request = new SoapObject(namesapce, methodname);

has is something to do with 64 bit machines??

How come the app that worked all these days stopped working all of a sudden?? Can someone enlighten me please. I'm stuck with this. Thanks for your time in advance.


回答1:


I had similar problem, simply I forgot to check checkbox on kosoap2 library in Java Build Path options, Order And Export tab :)




回答2:


I managed to solve the problem by

  1. Creating a folder "libs" in the project
  2. Copying the external jars in to the folder
  3. Refresh the folder
  4. Go to properties -> Build path -> Add Jar (not external JAR)
  5. Clean the project
  6. Restart Eclipse

Boom it worked for me. Hope it'll help others too.




回答3:


This may be related to the latest Android plugin and tools (r17). I read somewhere that external jar files need to be run through the dx --dex tool (because of the different binary format of Java binaries in Android), but it didn't work for me. What I ended up doing was adding the project as source instead of compiled binaries (by linking to the source from the project and adding it as a source folder.) This way Eclipse builds it properly and Android finds it during runtime.



来源:https://stackoverflow.com/questions/9866808/ksop2-librarary-class-not-found-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!