1. 程式人生 > >依賴包後出現Failed to resolve: com.github.Aspsine:SwipeToLoadLayout:1.0.3錯誤

依賴包後出現Failed to resolve: com.github.Aspsine:SwipeToLoadLayout:1.0.3錯誤

解決方法為:

在專案的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:[email protected]') { transitive = true }}
為什麼要這樣改呢?因為加入了一些外部資源,所以重新構建了一遍。實際上,
僅僅需要MD的Dialog樣式在styles.xml裡面自定義好就行了,只是為了方便寫成一個庫。
當然也可以這直接:
compile 'com.github.Aspsine:SwipeToLoadLayout:1.0.3'