title: Duplicate class found in modules classes.jar when implementing new dependency while building the project
body: <p>when I add new dependency <code>implementation 'com.github.GoodieBag:Pinview:v1.4'</code> gives error on the build. sync successfully.</p>
  
  <pre><code>Duplicate class android.support.design.widget.CoordinatorLayout$1 found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$Behavior found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$DefaultBehavior found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$DispatchChangeEvent found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$HierarchyChangeListener found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$LayoutParams found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$OnPreDrawListener found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$SavedState found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$SavedState$1 found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.design.widget.CoordinatorLayout$ViewElevationComparator found in modules classes.jar (com.android.support:coordinatorlayout:28.0.0) and classes.jar (com.android.support:design:26.0.1)
  Duplicate class android.support.v13.view.DragAndDropPermissionsCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.DragStartHelper found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.DragStartHelper$1 found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.DragStartHelper$2 found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.DragStartHelper$OnDragStartListener found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.EditorInfoCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.InputConnectionCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.InputConnectionCompat$1 found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.InputConnectionCompat$OnCommitContentListener found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.InputContentInfoCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.InputContentInfoCompat$InputContentInfoCompatApi25Impl found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.InputContentInfoCompat$InputContentInfoCompatBaseImpl found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  Duplicate class android.support.v13.view.inputmethod.InputContentInfoCompat$InputContentInfoCompatImpl found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v13:26.0.1)
  
  Go to the documentation to learn how to Fix dependency resolution errors.
  </code></pre>
  
  <p>Tried with  </p>
  
  <pre><code> implementation 'com.github.GoodieBag:Pinview:v1.4'{
          exclude group: "com.android.support", module: "support-compat"
          exclude group: "com.android.support", module: "coordinatorlayout"
      }
  </code></pre>
  
  <p>But same thing happed.</p>
  
  <p>if I add configuration like this</p>
  
  <pre><code> configurations {
          all {
              exclude group: "com.android.support", module: "support-compat"
              exclude group: "com.android.support", module: "coordinatorlayout"
          }
      }
  </code></pre>
  
  <p>gives this error</p>
  
  <pre><code>Android resource linking failed
  error: resource style/TextAppearance.Compat.Notification.Info (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Info) not found.
  error: resource style/TextAppearance.Compat.Notification.Info (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Info) not found.
  error: resource style/TextAppearance.Compat.Notification.Info (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Info) not found.
  error: resource style/TextAppearance.Compat.Notification (aka com.xuno.portal:style/TextAppearance.Compat.Notification) not found.
  error: resource style/TextAppearance.Compat.Notification (aka com.xuno.portal:style/TextAppearance.Compat.Notification) not found.
  error: resource style/TextAppearance.Compat.Notification (aka com.xuno.portal:style/TextAppearance.Compat.Notification) not found.
  error: resource style/TextAppearance.Compat.Notification.Time (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Time) not found.
  error: resource style/TextAppearance.Compat.Notification.Time (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Time) not found.
  error: resource style/TextAppearance.Compat.Notification.Time (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Time) not found.
  error: resource style/TextAppearance.Compat.Notification.Title (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Title) not found.
  error: resource style/TextAppearance.Compat.Notification.Title (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Title) not found.
  error: resource style/TextAppearance.Compat.Notification.Title (aka com.xuno.portal:style/TextAppearance.Compat.Notification.Title) not found.
  error: failed linking references.
  </code></pre>
  
  <p>this is my <code>build.gradle</code></p>
  
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'kotlin-android-extensions'
  apply plugin: 'kotlin-kapt'
  apply plugin: 'realm-android'
  
  apply plugin: 'io.fabric'
  
  
  android {
      compileSdkVersion 28
      defaultConfig {
          applicationId "com.xxx.yyy"
          minSdkVersion 21
          targetSdkVersion 28
          versionCode 14
          versionName "2.2.1"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          multiDexEnabled true
      }
  
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  
  }
  allprojects {
      repositories {
          maven { url "https://jitpack.io" }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
  
      androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
  
      implementation 'com.android.support:support-v4:26.0.1'
      implementation 'com.android.support:appcompat-v7:26.0.1'
      implementation 'com.android.support:design:26.0.1'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      implementation 'com.squareup.okhttp3:okhttp:3.9.0'
      implementation 'se.emilsjolander:stickylistheaders:2.7.0'
      implementation 'com.afollestad.material-dialogs:core:0.9.4.7'
      implementation 'com.google.firebase:firebase-core:11.4.0'
      implementation 'com.google.firebase:firebase-messaging:11.4.0'
      implementation 'com.google.android.gms:play-services:11.4.0'
      implementation 'com.android.support:multidex:1.0.1'
      implementation 'com.github.d-max:spots-dialog:0.7@aar'
      implementation 'com.android.support:recyclerview-v7:26.0.1'
      implementation 'com.google.zxing:core:3.4.0'
      implementation 'com.github.ybq:Android-SpinKit:1.2.0'
      implementation 'com.google.code.gson:gson:2.8.5'
      implementation 'es.voghdev.pdfviewpager:library:1.0.6'
      implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
      implementation 'com.squareup.picasso:picasso:2.71828'
      implementation 'com.github.chrisbanes:PhotoView:2.0.0'
      implementation 'de.hdodenhof:circleimageview:3.0.1'
      implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
      implementation 'com.nabinbhandari.android:permissions:3.8'
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
      implementation 'com.github.davidpizarro:pinview:1.0.0'
      implementation 'com.github.GoodieBag:Pinview:v1.4' //newly added one
  
  
  }
  
  apply plugin: 'com.google.gms.google-services'
  
  repositories {
      mavenCentral()
  }
  </code></pre>