Mehmet Kurtgoz
Mehmet Kurtgoz

Reputation: 187

duplicate files during packaging

I can not add a tube to the library I want to cache error, how do I resolve it?

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

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in 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'
}

Upvotes: 2

Views: 445

Answers (1)

ITurchenko
ITurchenko

Reputation: 1848

Just add packagingOptions { exclude 'builddef.lst' } to your gradle file - it should be enough.

Full version:

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'
    }
}

Upvotes: 1

Related Questions