Error: Could not find or load main class org.gradle.launcher.GradleMain
Basically this means that Gradle can't find your gradle/wrapper/gradle-wrapper.jar
.
You have to follow Step 3 and setup environment variables:
Microsoft Windows users
In File Explorer right-click on the This PC (or Computer) icon, then click Properties -> Advanced System Settings -> Environmental Variables.
Under System Variables select Path, then click Edit. Add an entry for C:\Gradle\gradle-3.5\bin. Click OK to save.
Source: https://gradle.org/install#configure
The easiest way, is to simply use gradlew.bat
in your project and it will auto download Gradle
for you!
I stopped all the gradle daemons by running ./gradlew --stop and the error was resolved for me.