How to eliminate dependency for aroma in gradle

We develop Android projects with a lot of tastes. One flavor includes aar, which binds android-async-http inside an aar file.

The problem is that we already define a compilation dependency for all of our tastes:

compile 'com.loopj.android:android-async-http:1.4.6'

and this leads to a failed build with an error:

 > com.android.build.api.transform.TransformException: java.util.zip.ZipException: 
duplicate entry: com/loopj/android/http/AssertUtils.class

I am trying to exclude this dependence for only one flavor. Sort of:

freeCompile('com.loopj.android:android-async-http:1.4.6') {
    exclude = true
}

In any case, to do this without defining a relationship for each flavor?

+4
source share

Source: https://habr.com/ru/post/1650834/


All Articles