Philip Wells
Philip Wells

Reputation: 1

java.util.zip.ZipException: duplicate entry

Please help, I can't build the application. I updated Android studio and my builds failed. Here is the full error: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/util/MessageThreadUtil$SyncQueueItem.class

and here are my dependencies: dependencies { compile 'com.android.support:multidex:1.0.1' compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile project(':cheetah-mobile-3.4.7') compile 'com.google.android.gms:play-services-ads:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.android.gms:play-services-appindexing:8.4.0' }

build.gradle:

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.bitcoinxpress"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    debug {
        debuggable true
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

Upvotes: 0

Views: 528

Answers (1)

Vince
Vince

Reputation: 171

You can view which dependencies conflict each other by typing this into the console:

    ./gradlew app:dependencies

I recommend starting your search from the library that is specified from the exception. Everything with an asterisk (*) in front of it signifies that it is conflicting with another library. The very first occurence of this library will not have a * and thats the one you know to keep. All of the other imports should be excluded like so:

    implementation('com.some.library:1.2.3') {
    exclude(group: "name.of.library.before.colon", module: "name-after-colon")
}

Since you are adding an exclude to this library you must surround the name of the lib with paranthesis as shown above.

Upvotes: 1

Related Questions