0

Following is my build.gradle file

buildscript {
    repositories {
        mavenCentral()
        maven { url "https://jitpack.io" }
    }

    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:3.3.0'
    }
}


repositories {
    mavenCentral()
    maven { url "https://jitpack.io" }
}

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    defaultConfig {
        applicationId "com.abc.def"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        generatedDensities = []
        multiDexEnabled true
    }
    dexOptions {
        javaMaxHeapSize "4g"
        incremental true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}
def final APP_COMPAT_VERSION = "24.0.+"

dependencies {

    compile "com.android.support:design:$APP_COMPAT_VERSION"
    compile 'com.android.support:cardview-v7:23.3.+'
    compile 'com.android.support:support-vector-drawable:23.3.+'
    compile 'com.android.support:cardview-v7:25.1.0'
    compile 'com.android.support:palette-v7:25.1.0'

    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.facebook.rebound:rebound:0.3.8'

}

Im getting the following error when I run this project

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

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/text/BidiFormatter$1.class

I tried to build after cleaning the project. I tried to delete the build folder and rebuilt the project again but still Im getting this error. How can I be able to solve this out?

  • It says duplicate entry http://stackoverflow.com/questions/33676742/java-util-zip-zipexception-duplicate-entry-android-support-v4-view-motionevent – Charuක Feb 12 '17 at 16:21
  • i have tried excluding option as in the article that you have quoted –  Feb 12 '17 at 16:23
  • http://stackoverflow.com/questions/26966843/java-util-zip-zipexception-duplicate-entry-during-packagealldebugclassesformult http://stackoverflow.com/a/29127909/5188159 – Charuක Feb 12 '17 at 16:24
  • that will exclude all support libraries –  Feb 12 '17 at 16:26

1 Answers1

0

Use support libraries of the same version.

compile "com.android.support:design:$APP_COMPAT_VERSION"
compile "com.android.support:cardview-v7:$APP_COMPAT_VERSION"
compile "com.android.support:support-vector-drawable:$APP_COMPAT_VERSION"
compile "com.android.support:cardview-v7:$APP_COMPAT_VERSION"
compile "com.android.support:palette-v7:$APP_COMPAT_VERSION"
Miha_x64
  • 5,973
  • 1
  • 41
  • 63