错误:使用Jar合并转换类以进行调试

时间:2017-05-09 11:56:01

标签: android debugging gradle

在部署apk时的特定设备中,我遇到了以下错误。我试图通过跟踪类似的问题来解决问题stack overflow link 1 link 2 link 3 ..我无法纠正它。附上实际错误。

  

错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。   com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / zxing / aztec / AztecDetectorResult.class

附上我的build.gradle供您参考。

apply plugin: 'com.android.application'

   android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
useLibrary 'org.apache.http.legacy'

defaultConfig {
    applicationId "com.fss.libyacustomer"
    minSdkVersion 19
    //targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/notice.txt'
}

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:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:support-v4:25.3.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile files('libs/zxing-2.1.jar')
compile files('libs/ksoap2-android-assembly-2.5.7-jar-with-dependencies.jar')
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
//Citrus
compile 'com.citruspay.sdk:payment-sdk:4.1.3'
compile 'com.journeyapps:zxing-android-embedded:3.4.0'
compile 'me.dm7.barcodescanner:zbar:1.8.2'
compile project(':qrpaylib')
compile 'com.android.support:multidex:1.0.1'

  }

请帮我解决。

1 个答案:

答案 0 :(得分:0)

看起来你拉着包含AztecDetectorResult类的多个罐子。看看你的build.gradle我可以看到

compile files('libs/zxing-2.1.jar')

compile 'com.journeyapps:zxing-android-embedded:3.4.0'

你需要两者吗?如果您只使用一个,请删除未使用的。

相关问题