How to enable dependencies in android gradle project library?

I am creating an Android library project using Gradle using Android Studio. It has some local dependencies:

compile project(':androidlibrary')

with nested additional external dependencies:

compile group: 'com.google.guava', name: 'guava', version: '14.0.1'

I managed to create aar file, but external or local dependencies are not included. I expect external dependencies to be mentioned in the POM file when published to maven, but what about local ones?

What is the right way to create such a project?

+8
java android maven gradle android-library
source share
2 answers

I ended up using the "download library from maven" function of Intellj IDEA , as described here . It loads the library and all its dependencies into a local directory.

Just a friendly warning: including addiction is considered very bad practice when MUST BE AVOIDED. This can cause conflicts.

+5
source share

There is no automated way to package library dependencies inside aar. This contradicts proper dependency management and can lead to problems down.

If you really want to do this, you will have to manually build the dependencies (using the code in build.gradle) and manually package the files in aar.

+2
source share

All Articles