gpt4 book ai didi

android - 如何修复 `duplicate class com.google.firebase.components`?

转载 作者:行者123 更新时间:2023-12-03 04:08:50 35 4
gpt4 key购买 nike

我开始在项目中使用MLKit条形码扫描仪,并在尝试运行该应用程序时收到Duplicate class错误。
另外,我尝试使用exclude firebase-commonexclude firebase-components,但没有帮助,因为它破坏了推送通知或MLKit扫描程序。
在Firebase和Google中,我们使用以下依赖项:

playServices: [
base : "com.google.android.gms:play-services-base:17.0.0",
maps : "com.google.android.gms:play-services-maps:17.0.0",
location : "com.google.android.gms:play-services-location:17.0.0",
safetynet: "com.google.android.gms:play-services-safetynet:17.0.0",
],
firebase: [
messaging: "com.google.firebase:firebase-messaging:20.0.0",
barcode: "com.google.mlkit:barcode-scanning:16.0.0"
]
Duplicate class com.google.firebase.components.AbstractComponentContainer found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component$$Lambda$1 found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component$$Lambda$2 found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component$$Lambda$3 found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component$1 found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.Component$Builder found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentContainer found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentDiscovery found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentDiscovery$1 found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentDiscovery$MetadataRegistrarNameRetriever found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
Duplicate class com.google.firebase.components.ComponentDiscovery$RegistrarNameRetriever found in modules jetified-firebase-common-19.0.0-runtime.jar (com.google.firebase:firebase-common:19.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)

and more classes ...

最佳答案

请尝试将其更新为最新版本的Firebase。第一季度的基础架构发生了一些变化。

关于android - 如何修复 `duplicate class com.google.firebase.components`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62578673/

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