title: Gradle: exclude dependencies from inside an aar
body: <p>I have imported an <em>aar</em> library to my project, included it in <em>libs</em> folder and added to gradle like following:</p>
  
  <pre><code>compile ('com.adclient.android.sdk:adclient-sdk-for-android-3.3.0@aar') {
      transitive = true
  }
  </code></pre>
  
  <p>The thing is that the <em>aar</em> cointains some dependencies inside that are also compiled in my project, and I get duplication errors.
  If I get the dependencies tree, the library looks empty:</p>
  
  <pre><code>+--- com.adclient.android.sdk:adclient-sdk-for-android-3.3.0:
  </code></pre>
  
  <p>Also, if I use <em>exclude</em> in the library compile statement, it has no effect. E.g:</p>
  
  <pre><code>compile ('com.adclient.android.sdk:adclient-sdk-for-android-3.3.0@aar') {
      exclude group: 'com.squareup.okhttp3',  module: 'okhttp'
      transitive = true
  }
  </code></pre>
  
  <p>I can exclude duplicated dependencies within the other libraries, but I prefer to keep them in the new dependency addition.
  So, is it possible to exclude dependencies inside the <em>aar</em>? What I'm doing wrong?</p>
  
  <p>Edit:</p>
  
  <p>This is the type of error I'm getting. It's a warning but our ProGuard stops because of that:</p>
  
  <blockquote>
    <p>Copying resources from program jar
    [/Users/adalpari/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.9.0/1b6c10b5120995a7542c1a31b7828fb8593c8ba/okhttp-3.9.0.jar]
    (filtered) Warning: Exception while processing task
    java.io.IOException: Can't write
    [/Users/adalpari/X/build/intermediates/transforms/proguard/production/release/jars/3/1f/main.jar]
    (Can't read
    [/Users/adalpari/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.9.0/1b6c10b5120995a7542c1a31b7828fb8593c8ba/okhttp-3.9.0.jar(;;;;;;**.class)]
    (Duplicate zip entry [okhttp3/a.class ==
    okhttp-3.9.0.jar:okhttp3/Address.class]))
    :AndroidApp:transformClassesAndResourcesWithProguardForProductionRelease
    FAILED</p>
  </blockquote>