0

I am Getting the error, once I build the code. Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/widget/DefaultItemAnimator$7.class

Gradle File Details

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
    applicationId "#######################################################"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    multiDexEnabled true //important
}
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.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'

//  Appodeal
compile project(':cheetah-mobile-3.4.7')
compile 'com.google.android.gms:play-services-ads:9.8.0'
compile 'com.google.android.gms:play-services-location:9.8.0'

}

MosesSoftEng
  • 485
  • 5
  • 13

2 Answers2

1

Android Studio Menu:

Build/Clean Project

Update old dependencies

from this answer

and make sure your lib folder doesn't have a duplicate library that already in you build.gradle

humazed
  • 74,687
  • 32
  • 99
  • 138
1

The default APPODEAL ZIP includes the

android-support-v7-recyclerview-23.1.1.jar 

file. That probably collides with one of your dependencies included in build.gradle.

**Just remove it ** (the required classes will be imported from the other dependency

iflorit
  • 740
  • 5
  • 10