美文网首页
使用maven { url "https://jitp

使用maven { url "https://jitp

作者: pdog18 | 来源:发表于2017-04-19 13:50 被阅读4797次

    使用

    maven { url "https://jitpack.io" }
    

    拉取第三方依赖时,需要在Porject

    repositories {
           // jcenter()
            maven { url "https://jitpack.io" }
        }
    

    例如 SwipeToLoadLayout 这个项目

    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" }
    如果你这么做了 ,那么很有可能你会遇到这个问题

    Error:(74, 13) 
    Failed to resolve: com.github.Aspsine:SwipeToLoadLayout:1.0.4
    Show in File
    Show in Project Structure dialog
    

    原因是因为你将添加的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

    相关文章

      网友评论

          本文标题:使用maven { url "https://jitp

          本文链接:https://www.haomeiwen.com/subject/leaczttx.html