“Failed to resolve dependencies” with Gradle

Sometimes when add a dependencied from libraries in Github, you got a error like the title said.

This troubles me for a while and finally I solved this by StackOverflow -> Link.

If you CLEAN your project, properly you will get a “peer not authenticated” error. And this is way Gradle can not download the dependencies while by default binary’ url use https scheme.

In your root “build.gradle” file, add these lines.

repositories {
    jcenter({url "http://jcenter.bintray.com/"})
}

And hopefully this can also solve your problem.