0

i am working with this guide with android studio, i added the following lines to my build.gradle:

compile 'org.jdom:jdom:1.1'
compile 'rome:rome:1.0'

and it gradle compiled it ok, but when i tried to run "debug" i got the following error:

Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Program Files\android-studio\sdk\build-tools\android-4.4W\dx.bat --dex --num-threads=4 ....... Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define LJDOMAbout$Author; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170) at com.android.dx.merge.DexMerger.merge(DexMerger.java:188) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287) at com.android.dx.command.dexer.Main.run(Main.java:230) at com.android.dx.command.dexer.Main.main(Main.java:199) at com.android.dx.command.Main.main(Main.java:103)

i removed the 'jdom' compile line (maybe it was already imported?), the i was able to run and debug succesfully but after running the follwing 2 lines:

SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(new ByteArrayInputStream(s.getBytes())));

the code ran fine, but i got the following while debugging:

very strange... it couldn't run toString(), i added the following line and got this mind boggling error:

it doesnt seem healthy keeping it all like this (althogh so far it works), it seems i somhow got 2 Object classes in my path or something similar.

of course i ran clean project.

whats going on here?

user1333057
  • 607
  • 1
  • 8
  • 19
  • There is also a newer release of Rome: http://mvnrepository.com/artifact/com.rometools/rome/1.5.0 where the package has changed from 'com.sun.syndication' => 'com.rometools.rome' and it depends on jdom 2.0.2 – janih Sep 27 '14 at 07:07

1 Answers1

0

the problem was that the

compile 'org.jdom:jdom:1.1'

line added the jdom 1.0 library as-well, manually adding both jars solved the issue

user1333057
  • 607
  • 1
  • 8
  • 19