Adding the path of Gradle in the previous answers is needed. In my case, I also needed to restart my computer.