0

In particular devices while deploying apk,I'm facing following error.I have tried to rectify them by following similar questions stack overflow link 1 link 2 link 3.. I cant able to rectify it. enclosing actual 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

Enclosing my build.gradle for your kind reference.

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'

  }

Please help me to crack it.

Kartiikeya
  • 2,358
  • 7
  • 33
  • 68

1 Answers1

0

it looks like your pulling in multiple jars containing the class AztecDetectorResult. Looking at your build.gradle I can see

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

and

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

Do you need both? If you're only using one, then remove the unused.

Pete Hendry
  • 291
  • 2
  • 7