将java库添加到android项目可以获得TOP LEVEL EXCEPTION

时间:2015-02-28 03:16:44

标签: java android android-studio dicom

我需要开发一个应该使用DICOM协议的应用程序,因此我需要使用像素库来提取文件数据,因为我知道imebra在这样的事情上很弱。但是当我将pixelmed.jar添加到我的lib文件夹并将行compile files('libs/pixelmed.jar')添加到我的build.gradle时,当我尝试构建并运行项目时,它给出了以下错误:

:app:preDexDebug
 UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: class name         (CompileDicomIODDescriptionsIntoXSLT) does not match path (com/pixelmed/validate/CompileDicomIODDescriptionsIntoXSLT.class)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.processClass(Main.java:704)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
at com.android.dx.command.dexer.Main.access$300(Main.java:83)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
...while parsing com/pixelmed/validate  /CompileDicomIODDescriptionsIntoXSLT.class
1 error; aborting
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException:  org.gradle.process.internal.ExecException: Process 'command '/opt/java  /jdk1.8.0_31/bin/java'' finished with non-zero exit value 1

知道如何解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

尝试使用JD-GUI反编译jar文件并直接使用类,这可能会解决问题