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

I am trying to create a new project for Android and get this error:

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

Compilation error; see compiler error output for details.

I do not see any compilation data in my intellij IDEA

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?

+7
android intellij-idea compilation build gradle
source share
1 answer

I have the same error and my solution is to change sourceCompatibility and targetCompatibility to JavaVersion.VERSION_1_7 as follows:

 compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } 

Also, maybe you need to change targetSdkVersion as suggested here

+2
source share

All Articles