Error:Failed to resolve: support-vector-drawable

后端 未结 9 1362
无人共我
无人共我 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:43

    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
      }
    }
    
    0 讨论(0)
  • 2020-12-28 21:49
    • i have tried enough and getting the same issue as in screen shot and finally got success.

    my code was like this..

    so after searching enough i solved it by adding maven in my gradle file..

    its solved then..

    0 讨论(0)
  • 2020-12-28 21:49

    You should add this to build.gradle(module: app)

    implementation 'com.android.support:support-vector-drawable:28.0.0'
    
    0 讨论(0)
  • 2020-12-28 21:49

    I try many but only this decoration help me to sync the Gradle, Hope this one help yours

     repositories {
            mavenLocal()
            google()
            jcenter()
    
        }
    

    And actually add this line to defaultConfig of app module :

    vectorDrawables.useSupportLibrary = true
    
    0 讨论(0)
  • 2020-12-28 21:50

    I faced this error on androidx project and solved it with:

    1- in Build.gradle (Module file), android{} section add:

       vectorDrawables.useSupportLibrary = true
    

    2- in dependencies {} section,

    change :

     implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
    

    to update version:

     implementation 'androidx.vectordrawable:vectordrawable:1.1.0-beta02'
    

    compile again.

    0 讨论(0)
  • 2020-12-28 21:55

    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()
        }
    }
    
    0 讨论(0)
提交回复
热议问题