我在构建代码后得到错误。 错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。
com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android / support / v7 / widget / DefaultItemAnimator $ 7.class
Gradle文件详细信息
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "#######################################################"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true //important
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
// Appodeal
compile project(':cheetah-mobile-3.4.7')
compile 'com.google.android.gms:play-services-ads:9.8.0'
compile 'com.google.android.gms:play-services-location:9.8.0'
}
答案 0 :(得分:1)
答案 1 :(得分:1)
默认的APPODEAL ZIP包含
android-support-v7-recyclerview-23.1.1.jar
文件。这可能与build.gradle中包含的某个依赖项发生冲突。
**只需将其删除**(所需的类将从其他依赖项中导入