Error:Failed to resolve: support-vector-drawable

In my case, I've moved the Google repo on the top in the build.gradle config:

allprojects {
  repositories {
      google() // now here
      mavenLocal()
      jcenter()
      maven {
          // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
      }
      // google() // was here
  }
}

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 just encountered this error along with some others:

Failed to resolve: support-vector-drawable
Failed to resolve: livedata-core
Failed to resolve: common
Failed to resolve: runtime
Failed to resolve: viewmodel
Failed to resolve: monitor

I'm not using React Native but found the answer on there:

In android/build.gradle move the jcenter() to the bottom:

allprojects {
    repositories {
        google()
        maven {
            url 'https://maven.google.com/'
        }
        jcenter()
    }
}

Tags:

Android

Gradle