2016-12-19 92 views
0

我已經上傳庫到bintray,但是當我嘗試在我的項目中使用它時,gradle build失敗並顯示錯誤:(26,13)無法解析:com.ymirski.library:date- utils的:0.0.1 Gradle無法解析來自bintray的依賴關係

這裏是我的應用程序的build.gradle依賴關係:

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.1.0' 
    testCompile 'junit:junit:4.12' 
    compile 'com.ymirski.library:date-utils:0.0.1' 
} 

項目的build.gradle:

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

所有的數據我從bintray了: enter image description here

enter image description here

+0

這意味着bintray中沒有這樣的庫。 –

+0

但我從bintray –

+1

得到這個鏈接,請鏈接到jcenter並使用 – Basi

回答

1

我想你沒有正確地發佈你的圖書館。如果你像在Gradle中一樣指定依賴項,它期望找到一個JAR文件,而不是一個AAR文件。如果Gradle支持取決於AAR文件(我不做Android開發),那麼您可能必須明確指出您需要使用compile 'com.ymirski.library:date-utils:[email protected]'的AAR。但即使如此,它也行不通,這讓我覺得你沒有正確地在Bintray上發佈。但是因爲我對Bintray不熟悉,所以我無法確切地告訴你什麼是錯誤的。

相關問題