title: Gradle "Duplicate class" error when adding uCrop and Cometchat libraries
body: <p>When I add the UCrop library version 2.2.3 and Cometchat SDK version 1.6.+ I get the following error :</p>
  
  <blockquote>
    <p>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)</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>I read many questions here on stackoverflow about the same topic, including
  <a href="https://stackoverflow.com/questions/44913406/exclude-one-class-file-in-gradle-android-studio">this</a> , <a href="https://stackoverflow.com/questions/40883974/gradle-exclude-a-dependencys-package">this</a>.</p>
  
  <p>I've also tried excluding okhttp3 library from one of the packages so that only one is used , using </p>
  
  <pre><code>implementation('com.github.yalantis:ucrop:2.2.3' )
      {       
  exclude group: 'com.cometchat', module: 'okhttp3'
    }
  
  </code></pre>
  
  <p>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.</p>