question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

[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)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
davidmotsoncommented, May 26, 2020

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

0reactions
ashwinraghavcommented, May 28, 2020

Hey @KonradSzewczuk

The goal of introducing com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava was to allow some androidx libraries to take a dependency on listenable future without taking a dependency on the entirety of guava.

This allows you to have both newer versions of guava and the androidX library (in your case browser) in your classpath without any duplicate class files.

The challenge we are facing is that the version of gRPC that Firebase libs depend on brings in a version of guava that is not new enough. And upgrading gRPC across the board in Firebase SDKs is non trivial https://github.com/firebase/firebase-android-sdk/pull/1534.

We hope to land that change in the coming weeks. Please unblock yourself by including `implementation ‘com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava’ in your build. While counterintuitive It is safe to continue having depending on it even after you pick up our fixes.

Please track #1152 going forward

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Duplicate class com.google.common.util.concurrent ...
0' in my app/build.gradle , I get this error: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.
Read more >
Duplicate class com.google.common.util ... - Google Groups
Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-16.0.1.jar (com.google.guava:guava:16.0.1) and ...
Read more >
Duplicate class com.google.common.util.concurrent ...
configurations { // Resolves dependency conflict caused by some dependencies use // com.google.guava:guava and com.google.guava:listenablefuture together.
Read more >
Duplicate class com.google.common.util ... - YouTube
java.lang.RuntimeException: Duplicate class com.google. common. util. concurrent. ListenableFuture found in modules guava-26.0-android.jar ...
Read more >
Firebase Android SDK Release Notes - Google
Update - November 17, 2022. Firebase Android BoM (Bill of Materials) version 31.1.0. Firebase Android SDKs mapped ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found