1

I got a Gradle Error:

Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/coremedia/iso/AbstractBoxParser$1;I want to used both isoparser-1.0.6.jar and compile 'com.googlecode.mp4parser:isoparser:1.+'

for my development purpose.My Gradle given below

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:appcompat-v7:22.2.0'

    compile 'com.jakewharton:butterknife:6.1.0'

    compile 'com.googlecode.mp4parser:isoparser:1.+'

    compile 'org.apache.commons:commons-io:1.3.2'

    compile files('libs/aspectjrt-1.7.3 (1).jar')
    compile files('libs/isoparser-1.0.6.jar')
}
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Gopinath
  • 23
  • 5
  • Possible duplicate of [Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;](https://stackoverflow.com/questions/7870265/unable-to-execute-dex-multiple-dex-files-define-lcom-myapp-rarray) – Sushin Pv Oct 27 '17 at 10:04
  • Remove the JAR files. Use actual Maven targets. – OneCricketeer Oct 27 '17 at 10:07
  • Actuly i am first compress video so used JAR and then Trim or cut video so used 'com.googlecode.mp4parser:isoparser:1.+'.If i remove JAR so compress after video sound was effected. – Gopinath Oct 27 '17 at 10:14

1 Answers1

0

Multiple dex files define Lcom/coremedia/iso/

You don't need the JAR files. The fact that you are using them is causing duplicate files, which Gradle can resolve on its own, but only when using Maven dependencies.

You compiled this ISO parser library already . And it depends on aspectjrt, so you don't need to explicitly compile that unless you really want to

https://mvnrepository.com/artifact/com.googlecode.mp4parser/isoparser/1.0.6

compile 'com.googlecode.mp4parser:isoparser:1.0.6'
compile 'org.aspectj:aspectjrt:1.8.2' // This version is used by isoparser:1.0.6

// compile files('libs/aspectjrt-1.7.3 (1).jar')
// compile files('libs/isoparser-1.0.6.jar')

You need to actually delete the JAR files because this line will compile them anyway. In other words, putting compile files() was redundant

compile fileTree(dir: 'libs', include: ['*.jar'])
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • If i remove JAR so compress after video sound was effected. – Gopinath Oct 27 '17 at 12:13
  • Actually i am used two lib in my project.One is for Video compress(https://github.com/lalongooo/VideoCompressor) and other is for video trim (https://github.com/titansgroup/k4l-video-trimmer).When I marge two code in my Project it show Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/coremedia/iso/AbstractBoxParser$1 in my gradle.I remove JAR and Run the Project it was effect Compress video sound(Video play with out sound). – Gopinath Oct 27 '17 at 12:23