NPE in CachingDirectedGraphWalker running "gradlew tasks"

NPE when trying to execute ./gradlew task:

I also keep getting this when running gradle 2.5 compiled from git master 676e7091437256

m> ./gradlew --no-daemon --stacktrace tasks
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
/* … */
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
:tasks


All tasks runnable from root project

Default tasks: assemble
:tasks FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:tasks’.
    java.lang.NullPointerException (no error message)
  • Try:
    Run with --info or --debug option to get more log output.
  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:tasks’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)

/* … */

Caused by: java.lang.NullPointerException
at org.gradle.internal.graph.CachingDirectedGraphWalker$NodeDetails.access$300(CachingDirectedGraphWalker.java:171)
at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:147)
at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64)
at org.gradle.api.internal.tasks.DefaultTaskContainer.realize(DefaultTaskContainer.java:193)
at org.gradle.api.internal.project.DefaultProjectTaskLister.listProjectTasks(DefaultProjectTaskLister.java:29)
at org.gradle.api.tasks.diagnostics.TaskReportTask.generate(TaskReportTask.java:66)
at org.gradle.api.tasks.diagnostics.AbstractReportTask.generate(AbstractReportTask.java:80)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:589)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:572)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
… 49 more

BUILD FAILED

Total time: 1 mins 0.565 secs

Might be related to https://issues.gradle.org/browse/GRADLE-2509 “NPE in org.gradle.api.internal.CachingDirectedGraphWalker”.

This is a known issue. @Rene, what’s the latest on this?

We’re working on a fix. I’ll keep you posted.