Java.util.zip.ZipException: re-write: android / support / v4 / accessibilityservice / AccessibilityServiceInfoCompatJellyBeanMr2.class

I integrate my project into another application in the Android studio, but it shows an error below, I run the problem, but do not use it.

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/AccessibilityServiceInfoCompatJellyBeanMr2.class 

below - application dependent

 configurations { all*.exclude group: 'com.android.support', module: 'support-annotations' } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':waleteros') compile 'com.android.support:recyclerview-v7:+' compile 'com.squareup.picasso:picasso:2.4.0' compile 'com.jakewharton:butterknife:5.1.2' compile files('src/libs/android_sync_service_library.jar') compile "com.google.android.gms:play-services:3.1.+" compile('com.crashlytics.sdk.android:crashlytics: 2.2.2@aar ') { transitive = true; } 

and here are my dependencies in the library

 configurations { all*.exclude group: 'com.android.support', module: 'support-v4' } configurations { all*.exclude group: 'com.android.support', module: 'support-annotations' } dependencies { compile project(':ingosdk') compile 'com.google.code.gson:gson:2.2.4' compile files('libs/A2iA.Mobility.jar') compile files('libs/acra-4.5.0.jar') compile files('libs/bugsense-3.5.jar') compile files('libs/deviceprint-lib-1.0.0.jar') compile files('libs/FlurryAnalytics-5.3.0.jar') compile files('libs/httpmime-4.1.2.jar') compile files('libs/libGoogleAnalyticsServices.jar') compile files('libs/volley.jar') compile 'com.actionbarsherlock:actionbarsherlock: 4.4.0@aar ' compile files('libs/android-support-v13.jar') } 
+6
source share
4 answers

If you have android-support-v4.jar in the libs .. folder, delete it!

This solved my problem.

Even if the file is not added to the build.gradle file. gradle still includes it in the assembly.

+11
source

I had the same problem after updating the Android SDK. I was able to run the application in buildToolsVersion '23.0.1' , I got the same error when I changed to buildToolsVersion '24.0.3'

I solved the problem by updating my java version from 1.7 to 1.8 using compileSdkVersion 24

+1
source

A similar problem, I just imported

 compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1' 

and got this error, after adding "@aar" the problem was resolved.

 compile 'fr.avianey.com.viewpagerindicator:library: 2.4.1.1@aar ' 
+1
source

In my opinion, this error is repeated duplicate jar file. I delete the V4 java support file in my library and then the clean build works fine. thanks

0
source

Source: https://habr.com/ru/post/989398/


All Articles