Gradle: how to include dependencies from repositories to output aar file

Konstantin Gindemit picture Konstantin Gindemit · Aug 15, 2016 · Viewed 20.1k times · Source

I am trying to build an arr package in Android Studio. This package contains dependecies for Zendesk:

allprojects {
    repositories {
        maven { url 'https://zendesk.artifactoryonline.com/zendesk/repo' }
    }
}

compile (group: 'com.zendesk', name: 'sdk', version: '1.7.0.1') {
    transitive = true
}

compile (group: 'com.zopim.android', name: 'sdk', version: '1.3.1.1') {
    transitive = true
}

I want to build this package for a Unity3d project. This package should contain all dependecies for Zendesk (the transitive = true property). When I open the aar file there is no dependencies for Zendesk. What is wrong?

Answer

and_dev picture and_dev · Aug 15, 2016

By default AARs do not include any dependencies. If you want to include them you have to copy these libs from artifactory/your cache folder into your package, either by doing it manually or this task might help you: https://stackoverflow.com/a/33539941/4310905