jobin jobin - 1 month ago 25
Android Question

android Transform Exception

I get the following exception when I tried to run my project on a device with Kitkat O.S. I am not sure what this error is.It workes perfectly on lollipop device.

Exception:

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


build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "23.0.3"


defaultConfig {
applicationId "com.stackoverflow.application"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true

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

}

}
}
repositories {
jcenter()
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile project(':payUMoneysdk')
}

Answer

It looks like you already have volley library in one of your dependencies.

Remove the following line from your build.gradle.

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