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:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 dependenciesHey @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