Error:Failed to resolve: support-vector-drawable

后端 未结 9 1363
无人共我
无人共我 2020-12-28 21:23

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

相关标签:
9条回答
  • 2020-12-28 21:56

    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' }
        }
      }
    
    0 讨论(0)
  • 2020-12-28 21:58

    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
    }
    
    0 讨论(0)
  • 2020-12-28 22:01

    I had the same problem. Resolved it via raising the version of v7 Support Libraries:

    implementation 'com.android.support:appcompat-v7:28.0.0'
    
    0 讨论(0)
提交回复
热议问题