简体   繁体   English

在Android Studio中集成ROME库(+是Android Studio跳闸了吗?)

[英]integrating ROME library in android studio (+ is android studio tripping?)

i am working with this guide with android studio, i added the following lines to my build.gradle: 我正在与Android Studio一起使用指南,我在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: 它gradle编译正常,但是当我尝试运行“调试”时,出现以下错误:

Error:Execution failed for task ':app:dexDebug'. 错误:任务':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; com.android.ide.common.internal.LoggedErrorException:无法运行命令:C:\\ Program Files \\ android-studio \\ sdk \\ build-tools \\ android-4.4W \\ dx.bat --dex --num-threads = 4 .......错误代码:2输出:异常最高级别异常:com.android.dex.DexException:多个dex文件定义了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) 在com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)在com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)在com.android.dx.merge.DexMerger.mergeClassDefs (DexMerger.java:533)在com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)在com.android.dx.merge.DexMerger.merge(DexMerger.java:188)在com.android。 com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)位于com.android.dx.command.dexer.Main的dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)在com.android.dx.command.dexer.Main.main(Main.java:199)在com.android.dx.command.Main.main(Main.java:103)处运行(Main.java:230)

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: 我删除了“ jdom”编译行(也许已经导入了吗?),我能够成功运行和调试,但在运行了以下两行后:

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: 非常奇怪...它无法运行toString(),我添加了以下代码行,并产生了令人难以置信的错误提示:

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. 保持这样的样子似乎并不健康(到目前为止还可以),似乎我在自己的路径中或类似的东西中有2个Object类。

of course i ran clean project. 当然我跑了干净的项目。

whats going on here? 这里发生了什么?

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 一行还添加了jdom 1.0库,手动添加了两个jar解决了该问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM