java.lang.noclassdeffounderror: org.ksoap2.serialization.SoapObject
Asked Answered
D

3

9

I got this no class def error: org.ksoap2.serialization.SoapObject error ever since I have updated Eclipse ADT Plug in and SDK Manager. I was using ksoap2-android-assembly-2.4-jar-with-dependencies.jar as external library for KSOAP. I thought that may be deprecated so i also added 2.6.2 version from here:http://code.google.com/p/ksoap2-android/source/browse/m2-repo/com/google/code/ksoap2-android/ksoap2-android-assembly/2.6.2/ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar

I still get the error. I have also search for it through the site but nothing helped.

Please help.

Code:

SoapServis servis = new SoapServis(SoapServis.KULLANICI_KONTROL);

where constructor is:

public SoapServis(String metodAdi) {
    this.METHOD_NAME = metodAdi;
    this.Request = new SoapObject(NAMESPACE, METHOD_NAME);
}
Duda answered 24/3, 2012 at 15:56 Comment(0)
D
29

Turns out external jars such as

ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar

to be put under /libs folder so Eclipse ADT automatically adds your jars to the buildpath of your application. It was a buildpath missing defined class error after all.. I hope this will help you, too!

Mustafa

Duda answered 25/3, 2012 at 7:19 Comment(0)
C
17

Go to Properties -> Java Build Path

Add ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar as external jar

Go to the Order and Export tab on the same popup window

Check the box against the newly added jar

(see: NoClassDefFoundError - Eclipse and Android)

Cenogenesis answered 26/3, 2012 at 17:15 Comment(0)
M
4

What I did:

  1. Download ksoap2-android-assembly-2.6.5-jar-with-dependencies, if you see it comes with zip extension. Change it to jar extension.
  2. Copy the jar file to libs folder on your project.
  3. Rebuild your project.
Mango answered 22/7, 2012 at 12:48 Comment(1)
:) this the only simple one worked for me ; i had gcm.jar google cloud messaging system thanks :) withouth build java path etc thingsDemarcation

© 2022 - 2024 — McMap. All rights reserved.