title: gradle exclude group from compile
body: <p>I am getting this duplicate error when building my app: </p>
  
  <blockquote>
    <p>addJar(...facebookadapter-4.0.3.jar): entry<br>
    duplicate entry: com/facebook/ads/AbstractAdListener.class</p>
  </blockquote>
  
  <p>The reason I am getting this is that my app compiles Facebook modules one belongs to an adapter and one to its original SDK:</p>
  
  <blockquote>
    <p>compile ('com.ironsource.adapters:facebookadapter:4.0.3@jar')
    compile 'com.facebook.android:audience-network-sdk:4.27.0'
        compile 'com.google.ads.mediation:facebook:4.27.0.0'</p>
  </blockquote>
  
  <p>So as a solution, I am trying to exclude this group from the module which contains the adapter jar compile statement:</p>
  
  <pre><code>compile ('com.ironsource.adapters:facebookadapter:4.0.3@jar') {
      exclude (group: 'com/facebook/ads')
  }
  </code></pre>
  
  <p>But, when I build my app again it fails to state the same reason from the same adapter</p>
  
  <p>Any idea why the classes are not being excluded?</p>