the error is:

Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/app/BackStackRecord$Op.class 

my gradle:

 apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion '25.0.1' defaultConfig { applicationId "бла бла" minSdkVersion 15 targetSdkVersion 25 versionCode 19 versionName "2.2.9" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }}} dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.github.stankoutils:app:1.3.1' compile 'com.anjlab.android.iab.v3:library:1.0.+' compile 'com.vk:androidsdk:1.6.8' compile 'com.github.bumptech.glide:glide:3.7.0' compile 'com.koushikdutta.ion:ion:2.+' compile 'com.github.ganfra:material-spinner:1.1.1' compile 'me.srodrigo:androidhintspinner:1.0.0' compile 'info.hoang8f:fbutton:1.0.5' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.jaeger.ninegridimageview:library:1.0.2' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.google.android.gms:play-services-maps:10.0.1' compile 'com.github.chrisbanes:PhotoView:1.3.0' compile 'de.psdev.licensesdialog:licensesdialog:1.8.1' compile 'com.google.firebase:firebase-messaging:10.0.1' testCompile 'junit:junit:4.12' compile 'com.daimajia.numberprogressbar:library:1.2@aar' compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' compile 'com.makeramen:roundedimageview:2.3.0' compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1' compile 'com.android.support:recyclerview-v7:25.1.0' compile 'com.android.support:cardview-v7:25.1.0' compile 'com.android.support:design:25.1.0' compile 'com.android.support:support-v4:25.1.0' } apply plugin: 'com.google.gms.google-services' 

    2 answers 2

    Apparently some of your dependencies already contain the v4 support library. You need to exclude it from these libraries when building it like this :

     compile ('com.android.support:appcompat-v7:22.1.1') { exclude module: 'support-v4' } 

    or simply deleting this lib. she already has

     //надо это удалить compile 'com.android.support:support-v4:25.1.0' 
    • It did not help, wrote the same error - sviter-pro
    • @ sviter-pro, try adding an exclusion mol to all libs - Yuriy SPb
    • It didn’t help either - sviter-pro
    • @ sviter-pro, if you cannot find the problem otherwise, create an empty project and start adding dependencies in turn. After each addition, collect the project - at some point it will give you your mistake and you will understand what exactly is causing your problem - YuriSPb
    • It is logical ... I will try - sviter-pro

    Check the libs folder, it seems that there you have a copy of com.android.support:support-v4 . Remove it from there.

    • I do not have such a folder - sviter-pro