Android:app:transformClassesWithJarMergingForDebug FAILED - ZipException:重复条目

时间:2015-10-06 10:53:55

标签: android android-studio gradle duplicates

很抱歉,如果我问了一个重复的问题,但我无法找到解决此错误的方法。我浏览了stackoverflow,gradle网站,android博客,google搜索,但是几个小时都没有工作解决方案。我是一个Android初学者,所以我不确定我是否错过了其他帖子中的内容。

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
         compileSdkVersion 23
         buildToolsVersion "23.0.0"

defaultConfig {
    minSdkVersion 14
    targetSdkVersion 22
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile 'com.android.support:appcompat-v7:22.2.1.'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
compile 'com.android.support:recyclerview-v7:22.2.1.'
compile 'com.android.support:cardview-v7:22.2.1.'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile files('libs/android-support-v4-22.2.1.jar')
compile files('libs/applovin-sdk-6.0.1.jar')
compile files('libs/appodeal-1.13.1.jar')
compile files('libs/chartboost-5.2.0.jar')
compile files('libs/my-target-4.0.13.jar')
compile files('libs/unity-ads-1.4.7.jar')
}

该项目工作正常,直到我从appodeal(那些编译文件行)添加一些库。我试图构建项目,但gradle给出了错误。

:app:transformClassesWithJarMergingForDebug'.
com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/widget/RecyclerView$ItemDecoration.class

关于重复输入,同样异常还有2个错误 - 不确定我为什么会这样做:android/support/v4/PrintKitKat.classandroid/support/multidex/MultiDex$V14.class

我尝试升级gradle,invalidate并重新启动以清除缓存,省略依赖关系然后重建/清理项目,找到要排除的潜在重复模块,并搜索那些.class的项目,但我发现没有重复。

1 个答案:

答案 0 :(得分:13)

您可以测试将其放在终端

目录的根目录中
./gradlew clean