title: Transitive dependencies not resolved for aar library using gradle
body: <p>I have investigated a while and probably saw most popular answers here related to <strong>aar</strong> and <strong>transitive dependencies</strong> but somehow it is still not clear for me how to make this working.</p>
  
  <p>So:</p>
  
  <p>I have android library with given gradle config:</p>
  
  <pre><code>apply plugin: 'android-library'
  apply plugin: 'android-maven'
  
  version = "1.0.0"
  group = "com.somepackage"
  
  buildscript {
      repositories {
          mavenCentral()
          mavenLocal()
      }
  
      dependencies {
          classpath 'com.github.dcendents:android-maven-plugin:1.0'
      }
  }
  
  android {
      compileSdkVersion 19
      buildToolsVersion '19.0.3'
  
      defaultConfig {
          minSdkVersion 10
      }
  }
  
  repositories {
      maven { url 'http://www.bugsense.com/gradle/' }
  }
  
  dependencies {
      provided 'com.google.android.gms:play-services:+'
      provided 'com.android.support:appcompat-v7:+'
      compile 'com.google.code.gson:gson:2.2.4'
      compile 'com.bugsense.trace:bugsense:3.6'
      compile 'commons-net:commons-net:3.3'
  }
  </code></pre>
  
  <p>Then I am deploying it to local maven repo with <code>gradle install</code>. POM file of the deployed library looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.sprezzat&lt;/groupId&gt;
    &lt;artifactId&gt;app&lt;/artifactId&gt;
    &lt;version&gt;1.0.0&lt;/version&gt;
    &lt;packaging&gt;aar&lt;/packaging&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.bugsense.trace&lt;/groupId&gt;
        &lt;artifactId&gt;bugsense&lt;/artifactId&gt;
        &lt;version&gt;3.6&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;commons-net&lt;/groupId&gt;
        &lt;artifactId&gt;commons-net&lt;/artifactId&gt;
        &lt;version&gt;3.3&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
        &lt;artifactId&gt;gson&lt;/artifactId&gt;
        &lt;version&gt;2.2.4&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>And finally gradle config of my android application using above library as a dependency:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.9.+'
      }
  }
  apply plugin: 'android'
  
  repositories {
      mavenCentral()
      mavenLocal()
  }
  
  android {
      compileSdkVersion 15
      buildToolsVersion "19.0.2"
  
      defaultConfig {
          minSdkVersion 10
          targetSdkVersion 18
      }
  }
  
  dependencies {
      compile 'com.google.android.gms:play-services:+'
      compile 'com.android.support:appcompat-v7:+'
      compile 'com.somepackage:LIBRARY_NAME:1.0.0@aar'
  }
  </code></pre>
  
  <p>And after deploying application on phone I am getting <code>NoClassDefFoundError</code> for classes belonging to compile dependencies of my android library. </p>
  
  <p>Inspecting my android application dependencies using <code>gradle dependencies</code>:</p>
  
  <pre><code>apk - Classpath packaged with the compiled main classes.
  +--- com.google.android.gms:play-services:+ -&gt; 4.3.23
  |    \--- com.android.support:support-v4:19.0.1 -&gt; 19.1.0
  +--- com.android.support:appcompat-v7:+ -&gt; 19.1.0
  |    \--- com.android.support:support-v4:19.1.0
  \--- com.somepackage:LIBRARY_NAME:1.0.0
  </code></pre>
  
  <p>According to above tree, all transitive dependencies are not detected. Where is the problem and how should it be done correctly?</p>