Search code examples
javaandroidzxing

android: Execution failed for task ':app:dexDebug' zxing barcode scanner


i am trying to use dm77/barcodescanner zxing from github and i've been trying to use this library but i always get Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 2

i've searched to other app:dex:Debug questions and problems and they said that i may have multiple dependencies. i tried to check it but i can't detect what or where these "multiple dependencies" are.

here's my code:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.quest.questsuser"
        minSdkVersion 18
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
    compile 'com.github.ksoichiro:Android-ObservableScrollView:v1.6.0'
    compile 'com.melnykov:floatingactionbutton:1.0.7'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.12.0'
    compile 'me.dm7.barcodescanner:zxing:1.8.4'
}
repositories {
    maven {
        url "https://jitpack.io"
    }
}

your help with be greatly appreciated.


Solution

  • I've already found the solution from https://www.youtube.com/watch?v=7uzWEjTVLQ4. 1. I added multiDexEnabled true in the default config build.gradle, added compile 'com.android.support:multidex:1.0.0' in the dependencies and in my Application Class i added a MultiDex.install(this); in the onCreate method