mcxiaoke / android-volley

DEPRECATED
4.29k stars 1.56k forks source link

Duplicate entry: com/android/volley/Request$Priority.class #164

Open ThathaPavanNagaraju opened 8 years ago

ThathaPavanNagaraju commented 8 years ago

FAILURE: Build failed with an exception.

habeebrahmanpt commented 7 years ago

i getting same issue Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/Request$Priority.class

heartandsoul commented 7 years ago

can you please check my gardle file? i have the same problem What went wrong: Execution failed for task ':app:transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/Request$Priority.class

My gardle file:

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion '25.0.0'

defaultConfig {
    applicationId "com.heartandsoulcafe.heartandsoul"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
configurations {
    all*.exclude group: 'com.android.volley', module: 'volley:volley'
    all*.exclude group: 'com.mcxiaoke.volley', module: 'volley:library-aar'
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/2'] } }

}

dependencies { compile project(':picasso-2.5.2') compile project(':GenAsync') compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.volley:volley:1.0.0' compile 'com.mcxiaoke.volley:library-aar:1.0.1' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.google.android.gms:play-services-appindexing:9.6.1' compile 'com.google.android.gms:play-services:9.6.1' compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9' compile 'com.android.support:multidex:1.0.1'

testCompile 'junit:junit:4.12'

}

ThathaPavanNagaraju commented 7 years ago

This issue occurs basically if there are duplicate libraries in two or more dependencies,

compile project(':picasso-2.5.2'){ transitive = true; } compile project(':GenAsync'){ transitive = true; } if this doesn't work see which of these above two dependencies uses volley and try to exclude that volley library during building gradle.