2017-02-20 38 views
0

在我們公司,我們已經開始模塊化我們的android項目,並且每個都有幾個依賴關係。我們使用JFrog artifactory來託管我們的aar文件。下面是代碼:如何在Android Gradle中添加Android歸檔的傳遞依賴關係

圖書館答:

compile "com.google.firebase:firebase-crash:$googlePlayServices" 
compile "com.google.firebase:firebase-core:$googlePlayServices" 
compile "com.squareup.retrofit2:retrofit:$retrofit" 

下不起作用。我也嘗試刪除「@aar」,但仍然沒有。 主要項目:

compile ('com.sample.librarya:librarya:[email protected]'){ 
    transitive = true 
} 

,因此我必須改造的依賴再次添加到主應用程序。

我已經做了大量的研究,並閱讀了很多SO問題,但沒有一個能夠幫助解決這個問題。我也擁有在其pom.xml文件中列出的LibraryA的所有依賴項。

+1

嘗試添加'compile「com.sample.librarya:librarya:[email protected]」' – sm4

+0

謝謝。這工作。唯一的一點是,首先我把「@pom」tp下載到pom中,並且必須用「@aar」替換它以使用aar文件。如何同時下載aar和pom文件。 –

回答

1

添加兩個以下相關:

compile ('com.sample.librarya:librarya:[email protected]') 
compile ('com.sample.librarya:librarya:[email protected]') 

首先將下載的POM並添加所有它的類路徑傳遞依賴。第二個將下載aar。