Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Gradle: Execution failed for task ':app:compileDebugJava'

I try to build me new android project and get this error:

Error:Gradle: Execution failed for task ':app:compileDebugJava'.

Compilation failed; see the compiler error output for details.

I don't see in my intellij IDEA any compilation details output

how can I add more details?

enter image description here

this is my gradle.build

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.14.2'
    }
}
apply plugin: 'com.android.application'

repositories {
    jcenter()
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "com.example.reminders"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:21.0.3'
    compile 'org.roboguice:roboguice:3.+'
    provided 'org.roboguice:roboblender:3.+'

}

do you know what went wrong?

like image 584
Elad Benda Avatar asked Jan 31 '15 20:01

Elad Benda


1 Answers

I've got the same error and my solution is to change sourceCompatibility and targetCompatibility to JavaVersion.VERSION_1_7 like this:

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

Also, possibly you need to change targetSdkVersion as suggested here

like image 130
azhidkov Avatar answered Oct 17 '22 19:10

azhidkov