gpt4 book ai didi

java - 如何修复 android studio 的所有/大多数依赖错误

转载 作者:行者123 更新时间:2023-12-01 23:16:48 27 4
gpt4 key购买 nike

我的依赖项不断收到“重复的类”,但我无法弄清楚它是哪一个。我需要所有这些。

我尝试一次删除一个,看看错误是否消失,但它只是给出了一个不同的错误,基本上告诉我我需要这种依赖关系。


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.android.gms:play-services-ads:18.2.0'
implementation 'com.google.android.material:material:1.0.0'
}

几行错误。没有给出完整的错误,因为 TLDR。

Duplicate class com.google.android.gms.internal.measurement.zzfq found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfr found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfs found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzft found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfu found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfv found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfw found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfx found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfy found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)
Duplicate class com.google.android.gms.internal.measurement.zzfz found in modules classes.jar (com.google.android.gms:play-services-measurement-impl:17.0.0) and classes.jar (com.google.firebase:firebase-analytics:16.0.4)

感谢大家的帮助!

最佳答案

基本上,这些类都在两个模块中。当我尝试在我的应用程序上使用 aws 服务时,出现此错误。您可以排除重复的模块,如下所示:

实现('com.google.firebase:firebase-database:16.0.4'){
排除组:'com.google.android.gms.internal.measurement'
}

关于java - 如何修复 android studio 的所有/大多数依赖错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58348126/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com