在模块 jetified-guava-26.0-android.jar 中发现重复类 com.google.common.util.concurrent.ListenableFuture

Mik*_*Lin 19 java android firebase

我有错误

在模块 jetified-guava-26.0-android.jar (com.google.guava:guava:26.0-android) 和 jetified-listenablefuture-1.0.jar (com.google) 中发现重复类 com.google.common.util.concurrent.ListenableFuture .guava:listenablefuture:1.0)

转到文档以了解如何修复依赖项解析错误。

更新后

类路径 'com.android.tools.build:gradle:3.5.3'

类路径 'com.android.tools.build:gradle:3.6.1'

和 gradle 5.4.1 到 5.6.4

降级时问题解决

实现 'com.google.firebase:firebase-firestore:21.4.1'

实现 'com.google.firebase:firebase-firestore:21.4.0'

这是firebase/firestore的错误吗?

Fer*_*han 25

我正在使用最新版本的 firebase firestore ie

implementation 'com.google.firebase:firebase-firestore:21.4.3'
Run Code Online (Sandbox Code Playgroud)

并添加这一行对我有用:

implementation 'com.google.guava:guava:27.0.1-android'
Run Code Online (Sandbox Code Playgroud)


Ray*_* Li 21

更新 Firebase 后,我也遇到了这个问题。

通过将以下包添加到您的 build.gradle

implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
Run Code Online (Sandbox Code Playgroud)

  • 当 FlutterFire 库遇到这个问题时,这很有效。 (4认同)

wil*_*t12 19

我认为问题的一部分是 Android Studio(或者可能是 Gradle 插件,但处理方式)建议将 Firestore 依赖项的版本更新到 21.4.1(可能取决于 build.gradle 中存储库的顺序 -不确定)。是的,似乎是 21.4.1 导致了这个问题。

Firestore lib 的 Gradle 升级建议到 21.4.1

所以是的,请忽略该建议并将其保留在 21.4.0。还...

  1. Firebase Docs将 21.4.0 显示为正确的版本。
  2. MVN Repository 显示 21.4.1作为最新版本。
  3. Google Maven Repo还将 21.4.1 列为最新版本。