gpt4 book ai didi

android - 更新了 firebase 依赖并得到重复的 protobuf 类错误

转载 作者:行者123 更新时间:2023-12-03 13:24:45 36 4
gpt4 key购买 nike

更新我的一个 Firebase SDK 后出现此错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class com.google.protobuf.AbstractMessageLite found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractParser found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractProtobufList found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.BooleanArrayList found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteBufferWriter found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
...
我的应用现在依赖于 protobuf-liteprotobuf-javalite ,这会触发重复类错误。

最佳答案

最近,Firebase Android 已经从依赖旧的 protobuf-lite 迁移过来了。依赖protobuf-javalite (github issue|PR implementing the change)。
您需要更新 受此更改影响的所有 Firebase SDK ,否则旧的 SDK 会将错误的依赖项拉入您的应用程序。
以下是受影响的 SDK 列表及其支持 protobuf-javalite 的版本

- com.google.firebase:firebase-firestore:21.5.0
- com.google.firebase:firebase-inappmessaging:19.1.0
- com.google.firebase:firebase-inappmessaging-display:19.1.0
- com.google.firebase:firebase-config:19.2.0
- com.google.firebase:firebase-abt:19.1.0
- com.google.firebase:firebase-perf:19.0.8
编辑:添加 firebase-perf到列表中,因为它传递依赖于配置并且也需要更新。

关于android - 更新了 firebase 依赖并得到重复的 protobuf 类错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62764605/

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