Reputation: 11
as title, I declare the dependencies in the build.gradle of my module, and export the library into an aar file. however, when I integrate the aar into another android project(let's say project B), I have to declare the sample dependencies again in project B.
my question is "is there anyway to include all the libraries in the aar file, and in the project B, I can only include that aar library without any other dependencies?"
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-vision:11.6.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.rmtheis:tess-two:9.0.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.12'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
}
but in my android project B, after the aar is included, I still need to add the other libraries.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.my.library:com.my.library@aar'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.12'
implementation 'com.google.android.gms:play-services-vision:11.6.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.rmtheis:tess-two:9.0.0'
}
Can anyone help? thanks.
Upvotes: 1
Views: 1766
Reputation: 410
By default AARs do not include any dependencies. If you want to include them you have to copy these libs from module into your package, either by doing it manually or this task might help you: https://stackoverflow.com/a/33539941/4310905
Upvotes: 0