"Delegate IDE build/run actions to gradle" from Intellij does not work

When I selected “Delegate IDE build/run actions to gradle” under Intellij Setting and run the application from Intellij, I got “Task ‘***.main()’ not found in root project …”.

But I have no problem to “gradlew run” from the root project. Any path that I have to set for “Delegate” gradle run from Intellij?

Thanks.