title: Use an aar library cause missing dependencies using api in Gradle 4.x
body: <p>When I build an app with a *.aar file instead of the module with Gradle 4.x and following the <a href="https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_separation" rel="noreferrer">docu</a> concerning <em>implements</em> and <em>api</em>, I expect using <em>api</em> the included aar file has all dependencies included, but it hasn't.</p>
  
  <p>When you do</p>
  
  <pre><code>git clone https://github.com/hannesa2/aar_dependency
  ./gradlew clean assembleDebug
  </code></pre>
  
  <p>means </p>
  
  <pre><code>dependencies {
      api project(':mylibrary')
  </code></pre>
  
  <p>it works properly.</p>
  
  <p>But when I use insted of lib-module the previous generated *.aar file as dependency</p>
  
  <pre><code> dependencies {
      api 'com.example.my.mylibrary:mylibrary-debug@aar'
  </code></pre>
  
  <p>(in <a href="https://github.com/hannesa2/aar_dependency" rel="noreferrer">demo app</a> just do)</p>
  
  <pre><code>git checkout with_aar
  ./gradlew clean assembleDebug
  </code></pre>
  
  <p>I run into this</p>
  
  <blockquote>
    <p>Task :app:transformClassesWithDesugarForDebug
    Exception in thread "main" java.lang.TypeNotPresentException: Type io.reactivex.ObservableTransformer not present
            at sun.invoke.util.BytecodeDescriptor.parseSig(BytecodeDescriptor.java:85)
            at sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:63)
            at sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:41)
            at java.lang.invoke.MethodType.fromMethodDescriptorString(MethodType.java:1067)
            at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:399)
            at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(Unknown Source)
            at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(Unknown Source)</p>
  </blockquote>
  
  <p>Because I ordinary run into this with uploading the aar artifacts into our company Maven Nexus, I created this <a href="https://github.com/hannesa2/aar_dependency" rel="noreferrer">demo-repo</a> to show exactly what's wrong. In demo app or using Maven I see the same issue. </p>
  
  <p>Does someone knows what I did wrong ?</p>