4

I tried many different things such as upgrading gradle but I cannot fix this issue. I can't get gradle to run:

./gradlew build --stacktrace
:......
:app:compileDebugJava
An exception has occurred in the compiler (1.8.0_25). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for bolts.Task not found
:app:compileDebugJava FAILED

FAILURE: Build failed with an exception.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJava'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)

This is my app>gradle.build

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "21.0.2"


    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src/main/java']
            resources.srcDirs = ['src/main']
            //aidl.srcDirs = ['src/main']
            renderscript.srcDirs = ['src/main']
            res.srcDirs = ['src/main/res']
            //assets.srcDirs = ['assets']
        }
    }
    productFlavors {
    }
}

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

This is my root> gradle.build

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.13.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

I also tried doing this guide but it was not working for me: Gradle build not working: Execution failed for task ':MyApp:compileDebug'

Community
  • 1
  • 1
dom
  • 321
  • 2
  • 12
  • This is really a duplicate of http://stackoverflow.com/questions/8881404/strange-compilation-error-with-maven but I won't close it as such yet. You have something screwy going on with the bolts.Task class and the compiler is (incorrectly) dying on it. – Scott Barta Oct 23 '14 at 16:18
  • did you fix your issue? I have the same one – Stephane Maarek Oct 30 '14 at 23:33
  • I changed to a different java compiler – dom Nov 02 '14 at 22:44

1 Answers1

5

Your error mention that Bolts is missing:

class file for bolts.Task not found

Try to add it to your dependencies by:

compile 'com.parse.bolts:bolts-android:1.+'

Matthieu
  • 51
  • 1