app:preDexDebug error in Android Studio

385 views Asked by At

I am using Android Studio 1.0.1 and Gradle 1.1.0. The following are my gradle dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'net.sourceforge.htmlunit:htmlunit:2.17'
}

Also, after seeing many answers on SO, I added the following too:

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}

I do not have any jar in the libs folder. I am getting the following error when I Run my application:

Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_20\bin\java.exe'' finished with non-zero exit value 1

Since the entire Gradle Build Message is large, I am pasting it here. I do not get the error when I remove the htmlunit dependency. From what I can gather, there seem to be some conflicting entities between htmlunit and some in-built Android libraries.

I have tried the solutions provided in other such questions, but none is working.

0

There are 0 answers