Updated June 24, 2020
You need to update to the latest gradle
version to solve this issue.
Please make sure you are on the latest Android Studio
and then update your project level build.gradle
by updating this dependency
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
}
}
It might show a popup asking your permission to update gradle
, please update and it will download the latest distribution automatically and the issue will be resolved.
Or else you can
Get Latest Gradle 5.6.4 from here and Add it manually
If you don't want to download it manually:
Open YourProject > gradle > wrapper > gradle-wrapper.properties
and replace
distributionUrl=https\://services.gradle.org/distributions/gradle-version-number-all.zip
With
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Rebuild the project or just run gradle sync again.