Search code examples
androidandroid-gradle-pluginbuild.gradletransitive-dependencygradle-dependencies

Android - Gradle - How to download transitive dependencies for an included jar


I have included a jar in my android project,

build.gradle

as

implementation files('libs/dependency_a.jar');

But there are dependencies with are needed by this jar file, which can be downloaded from the internet but don't get downloaded while building.

How do i get Gradle to download those dependencies automatically.

Thanks.


Solution

  • The dependencies won't be downloaded automatically in this case. You have to specify all the dependencies of your jar as dependencies for your app, in your app module's build.gradle file.

    android {
        ...
    }
    
    dependencies {
        //Dependencies of your app
                  +
        //Dependencies of your jar
    
    }