依赖包后出现Failed to resolve: com.github.dkzwm.SmoothRefreshLayout:core:1.6.3.3错误

依赖包后出现Failed to resolve: com.github.dkzwm.SmoothRefreshLayout:core:1.6.3.3错误_第1张图片

我们可能经常要用到一些github上的开源库(如何把自己的项目作为开源库这里写链接内容),然后可能会遇到上面图中的问题,原因是因为你将添加的maven { url “https://jitpack.io” } 添加至了buildscript 而不是allprojects

解决方法为:

在项目的build.gradle中添加:

allprojects {
repositories {
maven { url “https://jitpack.io” }//这就是添加的

}

}
然后在Module:app的build.gradle中添加:
dependencies {
compile fileTree(dir: ‘libs’, include: [‘*.jar’])
testCompile ‘junit:junit:4.12’
compile ‘com.android.support:appcompat-v7:24.2.1’
compile ‘com.github.Aspsine:SwipeToLoadLayout:1.0.3’
}

你可能感兴趣的:(android)