Runtime gradle exception

I know this is a recurring question, but I tried a lot of code, but couldn't solve the error

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.class 

gradle file

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.cwish" 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']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.1.0' compile 'com.android.support:recyclerview-v7:+' compile 'com.android.support:recyclerview-v7: 23.1.0@aar ' compile 'com.daimajia.numberprogressbar:library: 1.2@aar ' compile 'com.google.android.gms:play-services:8.3.0' compile 'com.koushikdutta.ion:ion:2.+' } 
+7
android android-studio
source share
2 answers

There seems to be a duplication problem, remove the com.android.support:recyclerview-v7 compilation: 23.1.0@aar , and everything will be fine.

+2
source share

I think this problem can be solved by removing duplicate dependencies, before deleting duplicate dependencies, you should check your modules with this command:

 gradlew -q dependencies yourProject:dependencies --configuration compile 

refer to this answer: problem with duplicate dependencies

Hope it can help you :)

+4
source share

All Articles