1

I am getting Execution failed error:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

My dependencies are:

compile fileTree(dir: 'libs', include: ['*.jar'])
//    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
//        exclude group: 'com.android.support', module: 'support-annotations'
//    })
compile 'com.android.support.constraint:constraint-layout:1.0.2'
//    testCompile 'junit:junit:4.12'

//support for multi dex
compile 'com.android.support:multidex:1.0.1'


//Dagger 2
compile 'com.google.dagger:dagger:2.9'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
provided 'javax.annotation:jsr250-api:1.0'

//recycler view
compile 'com.android.support:recyclerview-v7:25.3.1'

//retrofit
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'

//fast adapter
compile 'com.mikepenz:fastadapter:2.1.7@aar'
compile 'com.mikepenz:fastadapter-commons:2.1.0@aar'

//butter knife
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

//SDP
compile 'com.intuit.sdp:sdp-android:1.0.4'

//pull refresh layout
compile 'com.baoyz.pullrefreshlayout:library:1.2.0'

I tried this SO answer and getting this:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/view/ViewPager$2.class

What can I do to properly run my app?

Edit 1: I do not have any duplicate class. Here is a snapshoot:

enter image description here

A. K. M. Tariqul Islam
  • 2,824
  • 6
  • 31
  • 48
  • check if you **mistakenly have a copy of same class in the project files**. Also clean and Build. – shadygoneinsane May 25 '17 at 10:31
  • I checked. Please see the question again, I updated – A. K. M. Tariqul Islam May 25 '17 at 10:57
  • Try invalidating cache/restart also check if you recently moved some files around packages sometimes studio messes up with that - so just go to your manifest and cross check the class files; **from past experience, checking manifest for files and their proper packages helped me to build the project successfully** – shadygoneinsane May 25 '17 at 13:03
  • do you need `compile fileTree(dir: 'libs', include: ['*.jar'])`? could there be duplicates lurking in the libs folder; maybe jars that are already included via maven? – Jon May 26 '17 at 15:17
  • Nothing worked. I tried removing `compile 'com.baoyz.pullrefreshlayout:library:1.2.0'`, it worked. Created [this issue](https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh/issues/305) and waiting for them – A. K. M. Tariqul Islam May 28 '17 at 03:54

0 Answers0