2

I am using EBS payment gateway in my android application. EBS includes volley library in its folder. Also I use volley library for my project.So I get an exception like this.

Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: com/android/volley/AuthFailureError.class

And below is my gradle file

apply plugin: 'com.android.application'

android {
   compileSdkVersion 23
   buildToolsVersion "23.0.2"

repositories {
    mavenCentral()
}

configurations{
    all*.exclude group: 'com.android.volley', module: 'toolbox'
}

defaultConfig {
    applicationId "com.example.nivedha.rents"
    minSdkVersion 16
    targetSdkVersion 23
    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'])
   compile 'com.android.support:multidex:1.0.1'
   testCompile 'junit:junit:4.12'
   compile 'com.android.support:appcompat-v7:23.1.1'
   compile 'com.android.support:design:23.1.1'
   compile 'com.mcxiaoke.volley:library-aar:1.0.0'
   compile project(':EBS')
}

Help me out to fix this issue..

Nivedha S
  • 207
  • 4
  • 20
  • Go here http://stackoverflow.com/questions/30769483/error-java-util-zip-zipexception-duplicate-entry – CandleCoder Feb 19 '16 at 05:06
  • I use "all*.exclude group: 'com.android.volley', module: 'toolbox'" here. But I am not sure how to give the module in this line. @CandleCoder – Nivedha S Feb 19 '16 at 07:11

1 Answers1

5

Do like this :

When you added com.mcxiaoke.volley:library-aar:1.0.0 your some of the dependencies got clashed

So, now what you have to do is

  1. Search CTRL+SHIFT+N in android studio for the class AuthFailureError.class

  2. See which jar contains this and remove it like below (This is just as an example/You have to figure out the duplicate class and manually remove it)

configurations{
    all*.exclude module: 'toolbox'
}
Let'sRefactor
  • 3,303
  • 4
  • 27
  • 43
CandleCoder
  • 1,387
  • 4
  • 21
  • 45