I have a problem with gradle. it was working fine but all of sudden when I was rebuilding the project it gives me this error:
Error:Failed to resolve
Add vectorDrawables.useSupportLibrary = true
in defaultConfig
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
If an error still persists then
allprojects {
repositories {
google() // make it first element
jcenter()
maven { url 'https://maven.google.com' }
}
}
I had the same problem. you must change build.gradle to
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
maven { url 'https://maven.google.com' }
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I had the same problem. Resolved it via raising the version of v7 Support Libraries:
implementation 'com.android.support:appcompat-v7:28.0.0'