title: Duplicate classes in Gradle build, in Android Studio Application
body: <p>I have been stumped on this problem for hours, I am currently getting a duplicate classes error, when adding this specific dependency.</p>
  <pre><code>    implementation 'com.google.apis:google-api-services-vision:v1-rev369-1.23.0'
  </code></pre>
  <p>My App Level Build.gradle file is</p>
  <pre><code>  apply plugin: 'com.android.application'
  apply plugin: 'kotlin-android'
  apply plugin: 'com.google.gms.google-services'
  
  
  android {
      compileSdkVersion 30
      buildToolsVersion &quot;30.0.2&quot;
      defaultConfig {
          applicationId &quot;com.example.digitaldocs&quot;
          minSdkVersion 16
          targetSdkVersion 30
          versionCode 1
          versionName &quot;1.0&quot;
          multiDexEnabled true
          vectorDrawables.useSupportLibrary = true
  
  
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
      implementation 'com.google.android.material:material:1.0.0-beta01'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
      implementation 'androidx.vectordrawable:vectordrawable:1.0.0-beta01'
      implementation 'com.google.firebase:firebase-database:19.3.0'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'com.android.support:support-annotations:28.0.0'
      implementation 'com.google.firebase:firebase-ml-vision:24.0.3'
  
      testImplementation 'junit:junit:4.12'
      implementation 'com.android.support:multidex:1.0.3'
      //noinspection GradleCompatible
      implementation 'com.android.support:support-v4:26.1.0'
      implementation 'com.google.firebase:firebase-auth:19.4.0'
      implementation 'com.google.firebase:firebase-firestore:21.6.0'
      androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
      implementation &quot;androidx.core:core-ktx:+&quot;
      implementation 'com.google.apis:google-api-services-vision:v1-rev369-1.23.0'
  
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
  
      implementation 'androidx.annotation:annotation:1.1.0'
  }
  repositories {
      mavenCentral()
  }
  </code></pre>
  <p>my project level build.gradle file is</p>
  <pre><code>    // Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      ext.kotlin_version = '1.4.10'
      repositories {
          google()
          jcenter()
          
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:4.0.1'
          classpath 'com.google.gms:google-services:4.3.3'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <p><strong>My Stack Trace is as follows</strong></p>
  <pre><code>    Duplicate class com.google.common.annotations.Beta found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.annotations.GwtCompatible found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.annotations.GwtIncompatible found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.annotations.VisibleForTesting found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.Absent found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.AbstractIterator found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.AbstractIterator$1 found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.AbstractIterator$State found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.Ascii found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.CaseFormat found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.CaseFormat$1 found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.CaseFormat$2 found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.CaseFormat$3 found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.CaseFormat$4 found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  Duplicate class com.google.common.base.CaseFormat$5 found in modules jetified-guava-28.1-android.jar (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0.jar (com.google.guava:guava-jdk5:17.0)
  </code></pre>