简体   繁体   中英

Execution failed for task ':app:preDexDebug

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_65\\bin\\java.exe'' finished with non-zero exit value 1

This is the error I'm getting, I've recently updated my java to 1.8.0.65(if you couldn't tell) and I've updated the studio but after this and after I added mysql connector(not sure which is causing the issue) the latest 5.1.37.

This is how my build.gradle looks

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
    compileOptions.encoding = 'windows-1251'

    defaultConfig {
        applicationId "alexxela.xela.geitkontroll2000"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

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

I added the "compileOptions" after i didn't get it to work, but to no avail..

anyone gotten issues simular and know how to fix it?(I've googled and found several types of same error but they don't seem to work(not 100% same error))

I solved this problem by removing

compile fileTree(dir: 'libs', include: ['*.jar'])

Because the library file have already been in expansion ".jar"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM