SyncFailed Error:Cause: org/jetbrains/plugins/gradle/tooling/ModelBuilderService
So the problem was solved by deleting the .gradle
folder. Unfortunately none of the answers that I referred to described which .gradle
folder I was supposed to delete.
What I did was deleting the .gradle
folder inside the project structure. Instead, you have to delete the .gradle
folder located in
Windows:
C:/Users/<username>/.gradle.
MacOS:
~/Users/<username>/.gradle
To view hidden files on Mac press command+shift+.
Here is a very simple solution,open your gradle-wrapper.properties file in your project and change your distributionUrl by downgrading/upgrading it.
For example, if gradle 5.1 is giving you problems, you can downgrade to 4.9
distributionUrl=https://services.gradle.org/distributions/gradle-4.9-all.zip