I'm using Android Studio 1.4
I have a module in my project that's having next dependencies in build.gradle:
dependencies {
provided fileTree(dir: 'libs', include: ['*.jar'])
provided 'junit:junit:4.12'
apply plugin: 'com.google.gms.google-services'
provided 'org.apache.directory.studio:org.apache.commons.io:2.4'
provided 'com.google.android.gms:play-services:8.1.0'
provided 'com.fasterxml.jackson.core:jackson-databind:2.2.0'
provided 'com.fasterxml.jackson.core:jackson-core:2.2.0'
provided 'com.fasterxml.jackson.core:jackson-annotations:2.2.0'
}
After building the projectn and syncing gradle, I getting lib-release.aar at my module/build/ouputs/aar folder. Than I trying to File>New Module>Import JAR\AAR it. Then, after adding
compile project(':mylib-release')
I'm getting only my package without stated dependencies at "External Libraries" tree. How to enable autoinstall of these packages via only compilling my library?
Add your AAR or JAR as a dependency To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Jar Dependency in the dropdown.
Defining your dependency Now that Gradle knows which repository to look in, let's tell it what to look for. We do that within the dependencies section of the build script. Specify the co-ordinates, or in other words the group, artifactId, and version, within a string using a colon separator.
Ideally, there should be a pom file generated when you prepare AAR for deploy. You can find transitive dependencies of your AAR in that pom file.
Use
compile fileTree(dir: 'libs', include: ['*.jar'])
instead of
provided fileTree(dir: 'libs', include: ['*.jar'])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With