Java.util.zip.ZipException : duplicate entry support v4 PrintHelper$1. kind

Java.util.zip.ZipException : duplicate entry support v4 PrintHelper$1. kind … here is a solution to the problem.

Java.util.zip.ZipException : duplicate entry support v4 PrintHelper$1. kind

I’m not sure what this error means.

Error:Execution failed for task': eCampus :  packageAllDefaultFlavorDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: android/support/v4/print/PrintHelper$1.class

My bulid.gradle:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion '22.0.1'
    defaultConfig {
        applicationId "tw.edu.chu.ecampus"
        minSdkVersion 11
        targetSdkVersion 21
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    dexOptions {
        preDexLibraries = false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}
repositories {
    mavenCentral()
}
dependencies {
    compile project(':G0.10.ABS')//ActionBarSherlock
    compile project(':vitamio')
    compile 'com.google.android.gms:play-services-maps:7.5.0'
    compile 'com.google.android.gms:play-services-gcm:7.5.0'
    compile 'com.android.support:multidex:1.0.1'
    androidTestCompile 'com.android.support:multidex-instrumentation:1.0.1'
}

No errors occur during gradle sync. Just when I tried to run the application
What could be the problem?

Solution

I

got the same error and I solved it, but I just told you about my situation;

My bulid.gradle:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile ('com.android.support:appcompat-v7:22.0.0') 
    compile files('libs/android-async-http-1.4.8.jar')
    compile files('libs/android-support-v4.jar')
    compile files('libs/universal-image-loader-1.9.4-with-sources.jar')
}

The error is that com.android.support:appcompat-v7:22.0.0 contains support-v4.jar, so I removed it;

Solve build.gradle:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile ('com.android.support:appcompat-v7:22.0.0') {
        exclude module: 'support-v4'
    }
    compile files('libs/android-async-http-1.4.8.jar')
    compile files('libs/android-support-v4.jar')
    compile files('libs/universal-image-loader-1.9.4-with-sources.jar')
}

So maybe you should check your dependencies, maybe your build file has two files including support-v4

Related Problems and Solutions