I am migrating from Gradle 0.9.2 to 1.2 and getting below error after the version shift

D:\RJS>gradle clean build

FAILURE: Build failed with an exception.

  • Where: Build file ‘D:\RJS\build.gradle’ line: 1

  • What went wrong: A problem occurred evaluating root project ‘RJS’. > Could not find method dependsOnChildren() for arguments [] on root project ‘RJS’.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.533 secs

1.2 or 2.1?

the latest gradle 2.1 Sorry.

I believe the method was removed in 2.0. The release notes for 2.0 should have more information.

Thanks Peter, yes the method is deprecated in gradle 2.0 with task dependencies. Let me check the alternatives.

can i use evaluationDependsOnChildren() instead of dependsOnChildren(). i think they are same as i can make out from the description.

No you can’t. First step is to figure out why ‘dependsOnChildren()’ was used in the first place. Then, if no better solution is found for the problem at hand, ‘dependsOnChildren()’ has to be replaced with explicit task dependencies from tasks in the project that has ‘dependsOnChildren’ to equally named tasks in subprojects.

@Deprecated Project dependsOnChildren(boolean evaluateDependsOnProject) Deprecated. To definde task dependencies use Task.dependsOn(Object…) instead. For declaring evaluation dependencies to child projects, use evaluation dependencies use evaluationDependsOnChildren(). Declares that this project has an execution dependency on each of its child projects.

Parameters: evaluateDependsOnProject - If true, adds an evaluation dependency. Returns: this project.

and the description of evaluationDependsOnChildren() Declares that this project has an evaluation dependency on each of its child projects.