M. Erfan Mowlaei
M. Erfan Mowlaei

Reputation: 1436

Adding java library to android project gives TOP LEVEL EXCEPTION

I need to develop an app which should work with DICOM protocol, as a result I need to use pixelmed library to extract data of files since as much as I know imebra is weak in such a thing. But when I add pixelmed.jar to my lib folder and add the line compile files('libs/pixelmed.jar') to my build.gradle it gives me below error when I try to build and run the project:

: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

Any idea how to solve this problem?

Upvotes: 0

Views: 389

Answers (1)

Reza
Reza

Reputation: 4773

Try to use JD-GUI to decompile jar file and use classes directly,this might shed light on the issue

Upvotes: 1

Related Questions