如何修复错误重复条目:com/coremedia/iso/AbstractBoxParser$1.class?

How to fix error duplicate entry: com/coremedia/iso/AbstractBoxParser$1.class?

将 isoparser-1.0.6.jar 添加到 lib 文件夹后,出现类似这样的错误

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/coremedia/iso/AbstractBoxParser.class

这是我的 gradle:

dependencies {
    compile 'com.android.support:multidex:1.0.1'
    testCompile 'junit:junit:4.12'
    compile files('libs/vdopialwsdk.jar')
    compile files('libs/YouTubeAndroidPlayerApi.jar')
    compile files('libs/httpmime-4.4-beta1.jar')
    compile files('libs/httpcore-4.4.jar')
    compile files('libs/isoparser-1.0.6.jar')
    compile files('libs/android-websockets-master.jar')
    compile files('libs/zcsprinterV.jar')
    compile project(':library')
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:gridlayout-v7:23.3.0'
    compile 'com.android.support:cardview-v7:23.3.0'
    compile 'com.android.support:palette-v7:23.3.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.1'
    compile 'com.miguelcatalan:materialsearchview:1.4.0'
    compile 'com.github.quentin7b:android-location-tracker:3.2'
    compile group: 'org.igniterealtime.smack', name: 'smack-resolver-minidns', version: '4.1.7'
    compile group: 'org.igniterealtime.smack', name: 'smack-extensions', version: '4.1.7'
    compile group: 'org.igniterealtime.smack', name: 'smack-tcp', version: '4.1.7'
    compile group: 'org.igniterealtime.smack', name: 'smack-legacy', version: '4.1.7'
    compile group: 'org.igniterealtime.smack', name: 'smack-sasl-provided', version: '4.1.7'
    compile group: 'org.igniterealtime.smack', name: 'smack-android', version: '4.1.7'
    compile "org.igniterealtime.smack:smack-bosh:4.1.7"
    compile 'com.rockerhieu.emojicon:library:1.3.1'
    compile 'com.soundcloud.android:android-crop:1.0.0@aar'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.github.clans:fab:1.6.1'
    compile 'com.android.support:customtabs:23.1.0'
    compile 'com.github.ozodrukh:CircularReveal:1.1.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.0'
    compile 'com.newrelic.agent.android:android-agent:5.+'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:palette-v7:23.1.0'
    compile 'org.jetbrains:annotations:13.0'
    compile 'jp.wasabeef:glide-transformations:1.2.1'
    compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
    compile 'com.joooonho:selectableroundedimageview:1.0.1'
    compile 'de.greenrobot:androidsvg:1.2.2-beta-1-tweaked-2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
    compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.github.aakira:expandable-layout:1.6.0@aar'
    compile 'jp.wasabeef:picasso-transformations:2.1.0'
    compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
    compile 'com.github.ybq:Endless-RecyclerView:1.0.3'
    compile 'life.knowledge4:k4l-video-trimmer:1.0'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'org.aspectj:aspectjrt:1.8.5'

}

那么,如何解决呢? 最好的问候..

头痛了半天终于解决了这个问题。正如您提到的,原因是 isoparser。所以请将其添加到您的 build.gradle(Module:app)

compile('life.knowledge4:k4l-video-trimmer:1.1.3-SNAPSHOT') {
        exclude  group: 'com.googlecode.mp4parser', module: 'isoparser'
    }

问题已解决!编码愉快:)