Android :app:transformClassesWithJarMergingForDebug FAILED - ZipException: duplicate entry

转自:http://stackoverflow.com/questions/33209631/errorexecution-failed-for-task-apptransformclasseswithjarmergingfordebug
问题描述:
Good day. After update google repository in AndroidStudio, I have issue

Error:Execution failed for task ‘:app:transformClassesWithJarMergingForDebug’.

com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/cardview/BuildConfig.class
I’m try exclude group android.support from play-services, it did not help. When I start project on another PC I have:

Error:Execution failed for task ‘:app:transformClassesWithJarMergingForDebug’.

com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/AnimRes.class
my build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "ru.alexeyk.myevents"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 16
        versionName "1.121"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.github.nkzawa:socket.io-client:0.4.2') {
        exclude group: 'org.json', module: 'json'
    }
    compile files('libs/sentry-1.1.4.jar')
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:support-annotations:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:support-v4:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    compile 'com.github.machinarius:preferencefragment:0.1.2'
    compile 'com.edmodo:cropper:1.0.1'
    compile 'com.makeramen:roundedimageview:2.1.1'
    compile 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'
    compile 'com.yandex.android:mobmetricalib:2.00@aar'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.android.gms:play-services-ads:8.1.0'
    compile 'com.google.android.gms:play-services-analytics:8.1.0'
    compile 'com.google.android.gms:play-services-identity:8.1.0'
    compile 'com.google.android.gms:play-services-gcm:8.1.0'
}

解决办法:
cmd命令打开控制台,进入项目根目录,输入

gradlew clean

或者

Build/Clean Project

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值