title: How to resolve duplicate class exception caused by com.google.firebase:firebase-ml-vision:24.0.0
body: <p>While setting up the Text Recognizer for MLKit on Android for a react-native project (following this tutorial: <a href="https://firebase.google.com/docs/ml-kit/android/recognize-text?authuser=0" rel="nofollow noreferrer">https://firebase.google.com/docs/ml-kit/android/recognize-text?authuser=0</a>) I face an exception when launching the application with the <code>react-native run-android</code> command in my terminal. </p>
  
  <p>It states I have duplicate classes and I tracked it down to when I add <code>implementation 'com.google.firebase:firebase-ml-vision:24.0.0'</code> to the app/build.gradle</p>
  
  <p>Has anyone faced this before and resolved it? If I remove that line and change line 134 of android/app/build Gradle back to 'general' from 'mlkit' I can run my react-native-camera module but I cannot interface with the MLKit text recognizer.</p>
  
  <p>Exception:</p>
  
  <pre><code>Execution failed for task ':app:checkDebugDuplicateClasses'.
  &gt; 1 exception was raised by workers:
    java.lang.RuntimeException: Duplicate class com.google.android.gms.internal.vision.zzbm found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzck found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzcl found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzcm found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzjx found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzjy found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzjz found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzka found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzkb found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzkc found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzkd found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzke found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzkg found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
    Duplicate class com.google.android.gms.internal.vision.zzl found in modules classes.jar (com.google.android.gms:play-services-vision-common:19.0.0) and classes.jar (com.google.firebase:firebase-ml-vision-face-model:17.0.2)
  </code></pre>