xxxxxxxxxx
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()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
}
}