For Android studio 3.2.1+
Upgrade your Gradle Plugin
classpath 'com.android.tools.build:gradle:3.2.1'
If you are now getting this error:
Could not find com.android.tools.build:gradle:3.2.1.
just add google() to your repositories, like this:
repositories {
google()
jcenter()
}
Happy Coding -:)