Firebase-android-sdk: Duplicate class when using BoM

Created on 26 Oct 2020  ·  4Comments  ·  Source: firebase/firebase-android-sdk

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 4.1
  • Firebase Component: 25.12.0 BoM
  • Component version: 24.1.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Create a blank project with a simple blank activity, which only contains the following two implementations, and try and build the app in Android Studio.

Results in duplicate class errors such as this:

Duplicate class com.google.android.gms.internal.vision.zze found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)

(jetifier to false makes no difference android.enableJetifier=false)

Relevant Code:

dependencies {
    implementation platform('com.google.firebase:firebase-bom:25.12.0')
    implementation "com.google.firebase:firebase-ml-vision"
}

Full example in this SO post - https://stackoverflow.com/questions/64502154/duplicate-class-in-firebase-common-and-jetified-firebase-components-with-library - Includes debugging information

bom mlkit

Most helpful comment

Here is a workaround from Firebase doc. Does it work for you?

All 4 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

I got the same error? Trying to fix it since yesterday ... Any solutions?

Here is a workaround from Firebase doc. Does it work for you?

I have the same issue. Tried the workaround and many other potential solutions - nothing seems to fix it.

Was this page helpful?
0 / 5 - 0 ratings