This is the most common errors that we see in Android Studio and very often it is easy to fix.
Just follow these simple steps
- File -> Invalidate caches / Restart
- Shutdown Android Studio
- Rename/remove .gradle folder in the user home directory
- Restart Android Studio let it download all the Gradle stuff it needs
- Gradle build success should come(Make sure you are not behind any proxy).
- Rebuild project!
Try it, it should work…