0

I've added this library but when i want to build the project for debug it shows error like below

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException:java.util.zip.ZipException: duplicate entry: android/support/v4/util/DebugUtils.class

i tried everything like

multiDexEnabled true

or

dexOptions {
    javaMaxHeapSize "3g" //specify the heap size for the dex process
}

or

exclude group: 'com.android.support', module: 'support-v4'

but didn't work for me.

this is my build.gradle file dependencies

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile ('com.journeyapps:zxing-android-embedded:3.2.0@aar') {
        exclude group: 'com.android.support', module: 'support-v4'
}
compile ('com.google.zxing:core:3.2.1'){
    exclude group: 'com.android.support', module: 'support-v4'
}
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile ('com.ramimartin.bluetooth:AndroidBluetoothLibrary:1.0.1-SNAPSHOT') {
    exclude group: 'com.android.support', module: 'support-v4'
}
}

appreciate all of your suggestions.

masoud vali
  • 1,528
  • 2
  • 18
  • 29

1 Answers1

0

gradel defaultConfig { ... minSdkVersion 14 targetSdkVersion 21 ...

        // Enabling multidex support.
        multiDexEnabled true
    }
dependencies {
  compile 'com.android.support:multidex:1.0.0'
}

manifest

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android.multidex.myapplication">
    <application
        ...
        android:name="android.support.multidex.MultiDexApplication">
        ...
    </application>
</manifest>

But i have this error Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/util/DebugUtils.class

Take from Error:Execution failed for task ':app:transformClassesWithDexForDebug'

Community
  • 1
  • 1
Jonhatan Fajardo
  • 348
  • 6
  • 11