使用
maven { url "https://jitpack.io" }
拉取第三方依賴時(shí)昧绣,需要在Porject
下
repositories {
// jcenter()
maven { url "https://jitpack.io" }
}
例如 SwipeToLoadLayout 這個(gè)項(xiàng)目
How to
Step 1. Add the JitPack repository in your build.gradle at the end of repositories:
repositories { maven { url "https://jitpack.io" }}
Step 2. Add the dependency in the form
dependencies { compile 'com.github.Aspsine:SwipeToLoadLayout:1.0.4'}
Step 3. Look over Quick Setup for more details. You can find more customized header view and footer view in the demo app.
只是提示了在repositories
中添加maven { url "https://jitpack.io" }
如果你這么做了 亩进,那么很有可能你會(huì)遇到這個(gè)問題
Error:(74, 13)
Failed to resolve: com.github.Aspsine:SwipeToLoadLayout:1.0.4
Show in File
Show in Project Structure dialog
原因是因?yàn)槟銓⑻砑拥?code>maven { url "https://jitpack.io" } 添加至了buildscript
而不是allprojects
修改為
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
有可能就可以解決問題了税产。
感謝 http://stackoverflow.com/questions/33058358/jitpack-io-failed-to-resolve-github-repo