Android: creating an AAR with a library of dependent libraries
We create SDK project with below modules [And its dependencies are listed below]
- App [Android App]
- Dev-sdk [android library]
- Dev-sdk1 [android library]
- Dev-sdk2 [android library]
App (build.gradle)
dependencies {
compile project(path: ':Dev-sdk')
}
Dev-sdk (build.gradle)
dependencies {
compile project(path: ':Dev-sdk1 ')
}
Dev-sdk1 (build.gradle)
dependencies {
compile project(path: ':Dev-sdk2')
}
Dev-sdk2 (build.gradle)
dependencies {
// No Dependencies
}
When I try to create aar for "dev-sdk" it doesn't include dependencies.
Is there a way to create an AAR for the Dev-sdk module with all its dependencies?
+3
source to share
2 answers
I think you cannot add dependencies the way you want to do in your project. aar
don't have a config file that specifies the dependencies they need. You can do one of the following:
- Split the code from
Dev-sdk1
toDev-sdk
. Since you are the developer of everyoneSDKs
you use, this option is more suitable for you. - Or try uploading
Dev-sdk1
toMaven central repository
orBintray
. This way the person who will includeDev-sdk
in his project can easily add a dependency forDev-sdk1
with something like thiscompile abc.fgh.jik:version
+1
source to share