包装过程中重复文件

时间:2017-07-17 19:53:23

标签: android

我无法向库中添加管道我想缓存错误,我该如何解决?

错误:任务':app:transformResourcesWithMergeJavaResForDebug'的执行失败。

  

com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在APK builddef.lst中复制的重复文件       File1:C:\ Users \ Sims2.gradle \ _caches \ modules-2 \ files-2.1 \ com.googlecode.mp4parser \ isoparser \ 1.1.20 \ 44b7ee9785227a29db4048ee36758ffa553b749e \ isoparser-1.1.20.jar       File2:C:\ Users \ Sims2.android \ build-cache \ ac4f8b61ef7112ca250eee2e786463e96f1ea27c \ output \ jars \ classes.jar

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "*******"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-vector-drawable:25.3.1'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'jp.wasabeef:recyclerview-animators:2.2.3'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.hanks:htextview-rainbow:0.1.1'
    compile 'com.hanks:htextview-typer:0.1.1'
    compile 'com.google.firebase:firebase-ads:11.0.0'
    compile 'com.scottyab:aescrypt:0.0.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'jp.wasabeef:glide-transformations:2.0.2'
    compile 'com.squareup.picasso:picasso:2.5.1'
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'life.knowledge4:k4l-video-trimmer:1.0'
    compile 'com.iceteck.silicompressorr:silicompressor:2.0'
    testCompile 'junit:junit:4.12'
}

1 个答案:

答案 0 :(得分:1)

只需将packagingOptions { exclude 'builddef.lst' }添加到您的gradle文件中 - 它就足够了。

完整版:

android {
    compileSdkVersion 26
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "*******"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'builddef.lst'
    }
}