I have a Library project which has multiple modules, so that i centralised its dependencies in project level build.gradle like below
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'
}
and i used it in modules as
dependencies {
compile project(':module1')
compile rootProject.appcompat
compile rootProject.retrofit2
compile rootProject.gsonConverter
compile rootProject.httpLogInterceptor
compile rootProject.design
compile rootProject.cardview
compile rootProject.universalImageLoader
testCompile rootProject.junit
testCompile rootProject.mockito
androidTestCompile rootProject.junit
androidTestCompile rootProject.testRunner
}
in my sample app (another module in same project), i included the library module as compile project(':module2')
& it works fine but now i published the sdk in jcenter & if i use it in a new app, the dependencies i mentioned in the library are not resolving.
i tried including the dependency like
compile ('com.github.xxx:module2:1.0.0@aar') {
transitive=true
}
and
compile 'com.github.xxx:module2:1.0.0'
and
compile ('com.github.xxx:module2:1.0.0') {
transitive=true
}
i have tried
How to specify dependencies in aar library?
Can an AAR include transitive dependencies?
if i missed any info please comment
Thanks in advance