ZipException: re-entry: android / support / annotation / AttrRes.class

I encountered Error: execution completed for task ': app: packageAllDebugClassesForMultiDex'.

java.util.zip.ZipException: duplicate entry: android / support / annotation / AttrRes.class

build.gradle file (main project)

compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.google.android.gms:play-services-location:7.8.0' compile 'com.google.android.gms:play-services-maps:7.8.0' compile 'com.google.android.gms:play-services-gcm:7.8.0' compile 'com.google.android.gms:play-services-nearby:7.8.0' compile ('com.android.support:recyclerview-v7:+') { exclude module: 'support-v4' } compile 'com.firebase:firebase-client-android:2.3.1+' compile ('com.android.support:cardview-v7:22.0.+') { exclude module: 'support-v4' } compile ('com.squareup.okhttp:okhttp:2.4.0') { exclude module: 'support-v4' } compile ('com.squareup.picasso:picasso:2.5.2') { exclude module: 'support-v4' } compile ('com.squareup.retrofit:retrofit:2.0.0-beta1') { exclude module: 'support-v4' } compile('com.squareup.retrofit:converter-gson:2.0.0-beta1') { exclude module: 'gson' } compile('com.segment.analytics.android:all: 2.5.1@aar ') { transitive = true exclude module: 'support-v4' } compile ('com.android.support:design:22.2.0') { exclude module: 'support-v4' } compile('com.uservoice:uservoice-android-sdk:1.2.+') { exclude module: 'commons-logging' exclude module: 'httpcore' exclude module: 'httpclient' } compile('com.crashlytics.sdk.android:crashlytics: 2.5.2@aar ') { transitive = true; } compile project(':contactsChipView') compile files('libs/YouTubeAndroidPlayerApi.jar') compile project(':facebook-android-sdk-4.0.1') compile ('com.android.support:multidex:1.0.0'){ exclude module: 'support-v4' } 

The / libs directory (main project):

 gson-2.2.3.jar Parse-1.9.2.jar YoutubeAnddroidPlayerApi.jar 

Files in the / libs directory (facebook module):

 android-support-v4.jar bolts.jar 

As you can see the above gradle file, I tried to add an exception for almost all dependencies. But still no luck.

I also tried changing the build tools from 22.0.1 to 22.0.0, even this did not work.

I looked at other posts but no luck.

Does anyone know how to solve this?

+5
source share

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


All Articles