gradle错误的解决方法:app:transformClassesWithDexForDebug

时间:2017-05-25 10:30:55

标签: android android-gradle android-multidex

我收到Execution failed错误:

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;

我的依赖关系是:

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'

我尝试了this SO answer并得到了这个:

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

如何正确运行我的应用?

编辑1:我没有任何重复的课程。这是一个快照:

enter image description here

0 个答案:

没有答案