Android Studio - 重复 类 ... 在模块中找到 ... 和

Android Studio - Duplicate classes ... found in modules ... and

我已经四处寻找了几个小时,但找不到适合我情况的任何解释。

每次构建项目时,我都会遇到同样的错误:

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

Go to the documentation to learn how to Fix dependency resolution errors.

但是我完全不知道是哪个依赖项导致了这个问题。

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
def dynamicanimation_version = '1.0.0'
implementation "androidx.dynamicanimation:dynamicanimation:$dynamicanimation_version"
implementation 'com.plattysoft.leonids:LeonidsLib:1.3.2'
implementation 'com.ajts.androidmads.sqliteimpex:library:1.0.0'
implementation 'com.google.android.gms:play-services-ads:19.7.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.google.http-client:google-http-client-gson:1.26.0'
implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0')
        {
            exclude group: 'org.apache.httpcomponents'
        }
}

我在搜索所有 类 时都能看到它们: 但我仍然不知道问题出在哪里。

我对此比较陌生,所以我可能错过了一些信息。我可以提供您可能需要的任何其他代码或错误信息。

欢迎任何意见,谢谢!

我自己找到了答案。 事实证明它与某些 firebase 实现有关。

Google 已经创建了一个包来解决这个问题 要解决此冲突,只需将其添加到您的应用级别 build.gradle;

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