Duplicate class com.google.common.util.concurrent.ListenableFuture after BOM update

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.6.3
  • Firebase Component: Firestore, InAppMessages
  • Component version: Firestore: 21.4.3, InAppMessages: 19.0.6

[REQUIRED] Step 3: Describe the problem

Bumping the firebase-bom from 24.5.0 -> 25.3.1 to be able to use Firebase Kotlin Extensions ends up in dependencies error

Steps to reproduce:

Create brand new Android Studio project including below dependencies:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation platform('com.google.firebase:firebase-bom:25.3.1')
    implementation "com.google.firebase:firebase-inappmessaging-display-ktx"
    implementation "com.google.firebase:firebase-firestore-ktx"
    implementation "androidx.browser:browser:1.2.0"
    implementation "androidx.work:work-runtime-ktx:2.4.0-alpha03"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

When you try to build and run the project below error occurs:

Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-26.0-android.jar (com.google.guava:guava:26.0-android) and jetified-listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

1 possible answer(s) on “Duplicate class com.google.common.util.concurrent.ListenableFuture after BOM update

  1. Update: Due to some unforseen conflicts that those changes have with other firebase libraries we are delaying this fix so it can be properly tested. I’ll post back here as it progresses. For now, anyone seeing this issue should add

    implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
    to their dependencies