Reputation: 617
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?
Upvotes: 0
Views: 977
Reputation: 617
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
Upvotes: 0