Android Error Execution ZXing Integrated QR code reader

1

Well, here's my problem!

When I try to build my APK I get the following error

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/zxing/aztec/AztecDetectorResult.class

I enclose my gradle.app

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.3'
    defaultConfig {
        applicationId "com.example.ruben.codqrneodavid"
        minSdkVersion 19
        targetSdkVersion 25
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    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.2'
    compile 'com.android.support:design:25.3.1'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.android.support:support-v4:25.3.1'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services:10.2.6'

    compile ('com.journeyapps:zxing-android-embedded:3.5.0'){
    exclude group: 'com.google.zxing'
    }
    compile 'com.google.zxing:core:3.2.1'

}

How can I fix it ??

    
asked by Sam.Gold 13.06.2017 в 22:49
source

1 answer

0

According to the error:

  

duplicate entry: com / google / zxing / aztec / AztecDetectorResult.class

You should exclude when com.google.zxing is contained, within your build.gradle :

compile(contain com.google.zxing library) {
   exclude group: 'com.google.zxing'
}
    
answered by 13.06.2017 в 23:58