manish-kukreja / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

Adding .jar to project #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add lib folder to project
2. add ksoap2-android-2.2-jar-with-dependencies.jar to folder
3. add library to project

What is the expected output? What do you see instead?
When the library added, eclipse gave errors,like:

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: 
Lorg/ksoap2/transport/AndroidHttpTransport;
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.command.dexer.Main.processClass(Main.java:299)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.command.dexer.Main.processFileBytes(Main.java:276)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.command.dexer.Main.access$100(Main.java:56)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:228)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245
)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.command.dexer.Main.processOne(Main.java:245)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.dx.command.dexer.Main.run(Main.java:139)
[2009-04-11 11:41:44 - WebService1]     at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
[2009-04-11 11:41:44 - WebService1]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[2009-04-11 11:41:44 - WebService1]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[2009-04-11 11:41:44 - WebService1]     at java.lang.reflect.Method.invoke(Unknown 
Source)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.ide.eclipse.adt.build.DexWrapper.run(Unknown Source)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.ide.eclipse.adt.build.ApkBuilder.executeDx(Unknown Source)
[2009-04-11 11:41:44 - WebService1]     at 
com.android.ide.eclipse.adt.build.ApkBuilder.build(Unknown Source)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:3
09)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
[2009-04-11 11:41:44 - WebService1]     at 
org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
[2009-04-11 11:41:44 - WebService1] 1 error; aborting
[2009-04-11 11:41:44 - WebService1] Conversion to Dalvik format failed with 
error 1

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by aliciabo...@googlemail.com on 11 Apr 2009 at 8:45

GoogleCodeExporter commented 9 years ago
same problem over here! could the project owner fix this or publish a 
workaround?

Original comment by androidc...@googlemail.com on 13 Apr 2009 at 7:40

GoogleCodeExporter commented 9 years ago
The problem is that there are two .class files in this jar doubled. Look:
% jar tf ksoap2-android-2.2-jar-with-dependencies.jar| sort | uniq -c | sort 
-nr |
head -n 2
      2 org/ksoap2/transport/AndroidServiceConnection.class
      2 org/ksoap2/transport/AndroidHttpTransport.class

Workaround is to rename the jar file to .zip extension, remove doubled files 
(either
by hand in fancy graphical zip utility or by just command-line unzipping it 
answering
'[A]ll' when asked if override duplicated files and zipping it back) and rename 
back
to jar.

I suppose that real problem lies somewhere in the jar creation in build process.

Cheers!

Original comment by Krzyszto...@gmail.com on 15 Apr 2009 at 10:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thx Krzysztof.Goj. 
Problem fixed ;)

Original comment by androidc...@googlemail.com on 16 Apr 2009 at 4:29

GoogleCodeExporter commented 9 years ago
androidcrew, krzysztof

can you please post the complete source code on how to call soap server??

thanks

Original comment by tony.che...@gmail.com on 16 Apr 2009 at 9:03

GoogleCodeExporter commented 9 years ago
This is a duplicate of Issue #2.

Original comment by karl.mic...@gmail.com on 17 Aug 2009 at 12:03

GoogleCodeExporter commented 9 years ago
thank you. it helped me a lot :)

Original comment by alsw...@gmail.com on 7 Jul 2010 at 8:38

GoogleCodeExporter commented 9 years ago
jANO, thank's a lot! it works for me ...:!!!!!

Original comment by janoar...@gmail.com on 6 Aug 2011 at 12:04