2

I am using Eclipse. I have followed multiple tutorials for setting up ksoap on my android project. The ksoap2 jar file is included in my build path. The tutorial includes the lines below.

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    SoapSerializationEnvelope envelope = new SoapSerializaionEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);

SoapObject is underlined in red and when I hover over it I'm not prompted with an option to import it. Create class, Create interface, etc. are options.

Any help is greatly appreciated.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

alockrem
  • 767
  • 3
  • 9
  • 23
  • Make sure you are on the latest version of the Android developer tools and Eclipse ADT plugin. – CommonsWare Apr 04 '12 at 23:56
  • I dont have a Referenced Libraries folder in any of my projects. HAve you configured that lib in multiple places? It should only be set in one place [java build path] – kenyu73 Apr 04 '12 at 23:58
  • I added a screenshot of that as well. Everything appears to be up-to-date. – alockrem Apr 04 '12 at 23:58
  • This is the first time I have attempted to configure this lib with any project. – alockrem Apr 05 '12 at 00:02

2 Answers2

1

I copy the jars into my project's libs folder. Make the libs dir if its not there. Go into Eclipse select your project, right-click/refresh (F5 works?). You'll see the lib folder show up in your files panel.

Once the lib displays in your project, go into project->properties->java build path [add jars]. You should see your lib folder with the jar in that folder. Select it and you should be good.

Once that is setup, the project should see it... try using clean.

enter image description here

enter image description here

kenyu73
  • 671
  • 6
  • 16
  • That is exactly what I have done. All except "try using clean". I'm not sure what that means. – alockrem Apr 04 '12 at 23:46
  • I tried that an nothing changed. I have uploaded a screenshot to my original post. Maybe you'll see something I have missed. – alockrem Apr 04 '12 at 23:51
0

Click on the "Order and Import" tab and make sure the checkbox next to it is checked.

EDIT:

Try this: Please make sure that you have included all of these:

import org.ksoap2.*;

import org.ksoap2.serialization.KvmSerializable;

import org.ksoap2.serialization.Marshal;

import org.ksoap2.serialization.PropertyInfo;

import org.ksoap2.serialization.SoapObject;

import org.ksoap2.serialization.SoapPrimitive;

import org.ksoap2.serialization.SoapSerializationEnvelope;

import org.ksoap2.transport.AndroidHttpTransport;

import org.ksoap2.transport.HttpTransportSE;

import org.xmlpull.v1.XmlPullParserException;

Hope that helps!

LAST EDIT: It seems we have set up everything correctly. Re-download the jar file from this source. I feel that yours is not correct. Here: http://sourceforge.net/projects/ksoap2/

enter image description here

EGHDK
  • 17,818
  • 45
  • 129
  • 204
  • I dont think those need to be checked, at least I dont have those checked for my AdMob jar. – kenyu73 Apr 05 '12 at 00:00
  • It wasn't checked. I checked it and it still is not working. I added a screenshot to my original post for your reference – alockrem Apr 05 '12 at 00:01
  • Change libs folder to lib. Then right click on your Project. Click Properties. Hit java build path. Click Libraries tab. Click Add Jars. Then add your jar from the "lib" folder, and then click Order and Export and check it off. That's it. – EGHDK Apr 05 '12 at 00:04
  • If you are using ADT v17 you need to order and export. http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17 – EGHDK Apr 05 '12 at 00:07
  • I believe you. I have followed your instructions and it is exactly the same. I have uploaded an updated screenshot. Please let me know what to do next. – alockrem Apr 05 '12 at 00:09
  • The imports fail because org.ksoap2 cannot be resolved. (updated screenshot on original post). BTW - I really appreciate your help. I'm sure this is just as frustrating for you as it is for me. – alockrem Apr 05 '12 at 00:20
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/9709/discussion-between-alockrem-and-eghdk) – alockrem Apr 05 '12 at 00:23