Exclude duplicate entry on two aar Android
<p>I have used 2 third party <strong>aar</strong> dependencies in my Android Project and</p>

<p>they both are using same Encoding Library called <code>org.spongycastle.util</code>.</p>

<p>But problem here is when i compiled it it shows an Error on Gradle</p>

<pre><code>Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
&gt; com.android.build.api.transform.TransformException:java.util.zip.ZipException: duplicate entry: org/spongycastle/util/encoders/Base64.class
</code></pre>

<p>I tried to exclude one dependency from aar on Gradle complie by </p>

<pre><code>compile(name: 'libraryname', ext: 'aar') {
    exclude group: 'org.spongycastle.util'
}
</code></pre>

<p>But no luck of solving issue :(</p>

<p>Any help would be appreciated to exclude or ignore one dependency</p>