User Guide ch 15 : run example got project could not be found in root project

Run Example 15.6. Accessing tasks by path in the user guide

project(':projectA') {
    task hello
  task hello
  println tasks.getByPath('hello').path
println tasks.getByPath(':hello').path
println tasks.getByPath('projectA:hello').path
println tasks.getByPath(':projectA:hello').path

got this “Project with path ‘projectA’ could not be found in root project ‘projectA’” ,is there any conversion must observe?

This example assumes a ‘settings.gradle’ containing ‘include ‘projectA’’.

Thank you very much, Peter. Problem resolved. I read chapter 6:Build Script Basics, than click the link task details and read Chapter 15, More about Tasks . And I didn’t see something refer to settings.gradle. So got this confused.