In my case the reason was in this line:
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
My project used a third-party plugin, that is incompatible with the newest gradle plugin version. So updating plugins versions may help to solve the issue.