我有一個具有多個模塊庫項目,讓我集中其在項目層面的依賴的build.gradle像下面如何指定庫(SDK),其中有多個模塊
ext {
compileSdkVersion = 23
minSdkVersion = 9
targetSdkVersion = 24
buildToolsVersion = '23.0.3'
junit = 'junit:junit:4.12'
mockito = 'org.mockito:mockito-core:1.10.19'
testRunner = 'com.android.support.test:runner:0.5'
appcompat = 'com.android.support:appcompat-v7:24.1.0'
retrofit2 = 'com.squareup.retrofit2:retrofit:2.1.0'
gsonConverter = 'com.squareup.retrofit2:converter-gson:2.1.0'
httpLogInterceptor = 'com.squareup.okhttp3:logging-interceptor:3.4.1'
design = 'com.android.support:design:24.1.0'
cardview = 'com.android.support:cardview-v7:24.1.1'
universalImageLoader = 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
}
和依賴性我用它的模塊,
在我的示例應用程序(在同一項目中的另一個模塊),我包括在庫模塊compile project(':module2')
&它工作正常,但現在我發表在jcenter的SDK &如果我在一個新的應用程序中使用它,我在庫中提到的依賴關係不能解決。
我試圖包括
compile 'com.github.xxx:module2:1.0.0'
和
compile ('com.github.xxx:module2:1.0.0') {
transitive=true
}
我試圖像
compile ('com.github.xxx:module2:[email protected]') {
transitive=true
}
和
依賴性How to specify dependencies in aar library?
Can an AAR include transitive dependencies?
,如果我錯過了任何信息,請評論
在此先感謝
更新部分檢查POM文件中jcenter repo來驗證依賴關係是否在文件中。 –