KSOP2 Librarary class not found exception
Asked Answered
E

3

1

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.

Elagabalus answered 26/3, 2012 at 5:1 Comment(2)
have you moved your kSOP2 Library files as well ?Billiot
Yes I have moved the KSOP library and imported it as external JAR file in build properties. There are no errors shown in the IDE but when I run I get this error. ThanksElagabalus
E
3

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.

Elagabalus answered 26/3, 2012 at 5:2 Comment(0)
H
5

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

Hayleyhayloft answered 25/7, 2012 at 14:0 Comment(1)
Saved my day today! Wish I could +1 it a few more times! :DAvid
E
3

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.

Elagabalus answered 26/3, 2012 at 5:2 Comment(0)
P
1

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.

Popinjay answered 26/3, 2012 at 5:36 Comment(2)
Your answer did intrigue me to try something different. I created a libs folder in the project and placed the library inside libs. Imported them clicking "Add Jar". clened project and restarted eclipse. Boom! it worked. Update your answer I'll accept it as correct answer. Thanks for making me think out of the box. :) :)Elagabalus
@MayuMayooresan I think you'll do a better job... just add your answer below and accept it. My workaround might help someone else. Glad you overcame this :)Popinjay

© 2022 - 2024 — McMap. All rights reserved.