【发布时间】:2017-02-13 14:45:36
【问题描述】:
同步 gradle 文件时出现此错误
错误:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/zxing/client/android/camera/CameraConfigurationUtils.class
我尝试清理项目,重建项目和multidex,不包括模块。
我的 min sdk 是 19。如果大于 20,multidex 工作正常, 但在 SDK 19 中它不起作用。
这是我的 gradle 构建文件:
apply plugin: 'com.android.application'
android
{
compileSdkVersion 24
buildToolsVersion '25.0.2'
defaultConfig
{
applicationId "com.example.prototype_01"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
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.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.google.android.gms:play-services-appindexing:9.6.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'com.google.zxing:core:3.2.0'
compile 'com.github.bumptech.glide:glide:3.5.1'
//compile files('libs/android-core-3.2.1.jar')
compile 'com.android.support:support-v4:24.2.1'
compile 'com.tsengvn:Typekit:1.0.0'
compile 'com.google.firebase:firebase-messaging:9.6.1'
}
apply plugin: 'com.google.gms.google-services'
有什么办法可以解决这个问题?
【问题讨论】:
标签: android android-gradle-plugin build.gradle