0

I am trying to build a release version of my app in Android Studio, and no matter what I try I get the error message:

Execution failed for task 'app:transformClassesWithJarMergingForRelease'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/Request$Priority.class.

I've enabled multidex, cleaned and rebuilt my app, and nothing is working. The following is my gradle build:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "carter.streakly"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"

        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.google.android.gms:play-services-appindexing:8.1.0'
    compile 'com.google.android.gms:play-services:9.2.1'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.android.volley:volley:1.0.0'
    compile 'org.jetbrains:annotations-java5:15.0'
    compile 'com.android.support:support-v4:24.0.0'
    compile 'com.android.support:multidex:1.0.0'
}
piet.t
  • 11,718
  • 21
  • 43
  • 52
Carter Klein
  • 103
  • 6
  • maybe a duplicate. try to do this: http://stackoverflow.com/questions/33209631/errorexecution-failed-for-task-apptransformclasseswithjarmergingfordebug – Augusto Carmo Aug 26 '16 at 01:28

1 Answers1

0

In build.gradle dependencies you included two libraries:

compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.volley:volley:1.0.0'

wherecom.mcxiaoke.volley is basically a fork of official Google library, so you should use only one of them. Please also note, that according to the mcxiaoke/android-volley READ.ME :

(...) this project is deprecated and no longer being maintained, please use official version from jCenter.

compile 'com.android.volley:volley:1.0.0'

Community
  • 1
  • 1
Leszek Jasek
  • 2,206
  • 1
  • 23
  • 30