duplicate entry: com/android/volley/AuthFailureError.class while compiling project in android studio

Ankur Khandelwal picture Ankur Khandelwal · May 10, 2016 · Viewed 8.4k times · Source

I am using external libraries payu money sdk and linkedin-sdk, both uses volley libraries, which while compiling project gives duplicate entry of AuthFailureError.class

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

java.util.zip.ZipException: duplicate entry: com/android/volley/AuthFailureError.class"

i have also added following code to exclude module, but still same error

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

please help

Answer

hsm59 picture hsm59 · Mar 30, 2017

I stumbled upon this same error, and after reading this, I was able to solve it.

Try adding this line inside your app dir build.gradle file -

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

Hope this helps.