-2

I want to add some third-party libraries, but I always got the "Failed to resolve" error. I tried some suggestions I found here, like: Error:(23, 17) Failed to resolve: junit:junit:4.12 , Gradle failed to resolve library in Android Studio and Gradle in Android Studio: Failed to resolve third-party libraries but it didn't work! how can I solve the problem? thanks in advance enter image description here

Community
  • 1
  • 1
TeachMePls
  • 197
  • 1
  • 2
  • 11

3 Answers3

1

You should check your gradle files and write down mavenLocal() at the build.gradle(Project: your project name)

allprojects {
repositories {
    jcenter()
    mavenLocal()
}

}

YOUNG MIN CHO
  • 253
  • 1
  • 3
  • 13
0

libraries which you want to add are at maven or at any other repository, you need to add repository. so that gradle can download library from that repository.

let me know if you need more help.

Developine
  • 12,483
  • 8
  • 38
  • 42
-1

mavenCentral(); just add ";".I solve it by this way.

Zurich
  • 1
  • 2