Basta alterar o arquivo gradle-wrapper.properties (imagem abaixo)
Para isso (se o seu gradle for com.android.tools.build:gradle:3.0.1
)
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip // this version or above|
Para gradle
com.android.tools.build:gradle:3.2.1
Usa isto
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
ATUALIZAR
Para seguir gradles
//# 1
com.android.tools.build:gradle:3.0.1
//# 2
com.android.tools.build:gradle:3.1.0
//# 3
com.android.tools.build:gradle:3.2.1 //or 3.2.0
//# 4
com.android.tools.build:gradle:3.3.2 //or 3.3.0
//# 5
com.android.tools.build:gradle:3.4.0
//# 6
com.android.tools.build:gradle:3.5.0
Use os seguintes urls
//# 1
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
//# 2
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
//# 3
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
//# 4
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
//# 5
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
//# 6
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Não se esqueça de adicionar google()
repositórios de buildscript.