When I add the UCrop library version 2.2.3 and Cometchat SDK version 1.6.+ I get the following error :
Duplicate class okhttp3.Address found in modules okhttp-3.11.0.jar (com.squareup.okhttp3:okhttp:3.11.0) and okhttp-3.12.0.jar (com.cometchat:pro-android-chat-sdk:1.6.0)
The problem is that none of the previously asked questions have answers that solved my problem because most of them use the 'compile' method which is now deprecated.
I read many questions here on stackoverflow about the same topic, including this , this.
I've also tried excluding okhttp3 library from one of the packages so that only one is used , using
implementation('com.github.yalantis:ucrop:2.2.3' )
{
exclude group: 'com.cometchat', module: 'okhttp3'
}
I would appreciate it if someone could explain to me how excludes work in gradle and what's wrong with the code that I wrote.