Duplicate jar entry [com/google/common/util/concurrent/ListenableFuture.class]
Caused by having,
com.google.guava:listenablefuture:1.0
and
com.google.guava:guava:22.0-android
both exist as dependencies. This can sneakily happen if this situation happens because of transitive dependencies.
Explicitly depend on both the pre-27 version of Guava, and the empty version of ListenableFuture,
implementation "com.google.guava:guava:22.0-android"
implementation "com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava"
The version number being 9999 is large enough for the default dependency resolution strategy to pick this one. This avoids duplicate by simply importing a version of the listenablefuture
with nothing in it.
- This is actually mentioned in the pom.xml file for listenablefuture version 9999.
- This is not a problem if you can update Guava to version 27, in which case per the pom file, it will resolve itself (with Gradle's resolution strategy at least)