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 C:/Users/<username>/.gradle.