Android :app:transformClassesWithJarMergingForDebug 失败 - ZipException: 重复条目 [英] Android :app:transformClassesWithJarMergingForDebug FAILED - ZipException: duplicate entry
问题描述
很抱歉,如果我问了一个重复的问题,但我找不到此错误的解决方案.我浏览了 stackoverflow、gradle 站点、android 博客、google 搜索,但几个小时都没有一个可行的解决方案.我是一名 android 初学者,所以我不确定我是否遗漏了其他帖子中的内容.
Sorry if I asked a duplicate question, but I couldn't find a solution for this error. I surfed around stackoverflow,gradle site, android blogs, google search but there wasn't a working solution for several hours. I'm an android beginner so I not sure if I have missed something in other posts.
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 给出了错误.
The project was working fine until I add some libs from appodeal (those compile file lines). I have tried to build the project but gradle gave the errors.
: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.class
和 android/support/multidex/MultiDex$V14.class
.
There are also 2 more error of the same exception about duplicate entry- not sure why I got them: android/support/v4/PrintKitKat.class
and android/support/multidex/MultiDex$V14.class
.
我尝试升级 gradle,使无效并重新启动以清除缓存,省略依赖项然后重建/清理项目,找到要排除的潜在重复模块,并在项目中搜索那些 .class
但我没有发现重复.
I tried to upgrade gradle, invalidate and restart to clear cache, omit dependencies then rebuild/clean project, find potential duplicate module to exclude, and search projects for those .class
but I found no duplication.
推荐答案
你可以测试把这个放到终端的根目录
You can test putting this on root of directory in the Terminal
./gradlew clean
这篇关于Android :app:transformClassesWithJarMergingForDebug 失败 - ZipException: 重复条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!