解决 Firebase In App Messaging 和 Dialogflow 依赖项

Posted

技术标签:

【中文标题】解决 Firebase In App Messaging 和 Dialogflow 依赖项【英文标题】:Resolve Firebase InApp Messasing and Dialogflow dependencies 【发布时间】:2020-06-22 09:22:38 【问题描述】:

我有一个项目,我同时使用 FirebaseInAppMessaging 和 Dialogflow,但我很难解决依赖关系。添加 FirebaseInAppMessaging 和 Dialogflow 后,我收到以下错误:

Duplicate class com.google.protobuf.AbstractMessageLite found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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 the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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 the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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$InternalOneOfEnum found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.AbstractParser found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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 the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.AllocatedBuffer found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.AllocatedBuffer$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.AllocatedBuffer$2 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.android found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Any found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Any$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Any$Builder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.AnyOrBuilder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.AnyProto found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Api found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Api$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Api$Builder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ApiOrBuilder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ApiProto found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ArrayDecoders found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ArrayDecoders$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ArrayDecoders$Registers found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryReader found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryReader$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryReader$SafeHeapReader found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryWriter found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryWriter$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryWriter$SafeDirectWriter found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryWriter$SafeHeapWriter found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryWriter$UnsafeDirectWriter found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BinaryWriter$UnsafeHeapWriter found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BoolValue found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BoolValue$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BoolValue$Builder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BoolValueOrBuilder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BooleanArrayList found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.BufferAllocator found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BufferAllocator$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ByteBufferWriter found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteOutput found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$1 found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$2 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ByteString$AbstractByteIterator found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.ByteString$ArraysByteArrayCopier found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$BoundedByteString found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$ByteArrayCopier found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$ByteIterator found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$CodedBuilder found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$LeafByteString found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$LiteralByteString found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$Output found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.ByteString$SystemByteArrayCopier found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.BytesValue found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BytesValue$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BytesValue$Builder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.BytesValueOrBuilder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStream found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedInputStream$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStream$ArrayDecoder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStream$IterableDirectByteBufferDecoder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStream$StreamDecoder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStream$StreamDecoder$RefillCallback found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStream$StreamDecoder$SkippedDataSink found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStream$UnsafeDirectNioDecoder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStreamReader found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedInputStreamReader$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedOutputStream found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedOutputStream$1 found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedOutputStream$AbstractBufferedEncoder found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedOutputStream$ArrayEncoder found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedOutputStream$ByteOutputEncoder found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedOutputStream$HeapNioEncoder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedOutputStream$OutOfSpaceException found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedOutputStream$OutputStreamEncoder found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.CodedOutputStream$SafeDirectNioEncoder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedOutputStream$UnsafeDirectNioEncoder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedOutputStreamWriter found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.CodedOutputStreamWriter$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.DoubleArrayList found in the following modules: jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3), 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.DoubleValue found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.DoubleValue$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.DoubleValue$Builder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.DoubleValueOrBuilder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Duration found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Duration$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Duration$Builder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.DurationOrBuilder found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.DurationProto found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Empty found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)
Duplicate class com.google.protobuf.Empty$1 found in modules jetified-protobuf-java-3.11.3.jar (com.google.protobuf:protobuf-java:3.11.3) and jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0)


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

那么如果我排除依赖项如下:

implementation.exclude module:'protobuf-java'
implementation.exclude module:'protobuf-javalite'
implementation.exclude module:'proto-google-common-protos'

我收到以下错误:

QueryInput.Builder queryInput = QueryInput.newBuilder();
                                                  ^
class file for com.google.protobuf.MessageOrBuilder not found

然后我将排除模块更改为

implementation.exclude module: 'protobuf-lite'
implementation.exclude module:'protobuf-javalite'
implementation.exclude module:'proto-google-common-protos'
implementation.exclude module: 'protolite-well-known-types'

代码编译成功,但安装后应用立即崩溃。我做了一些研究,并意识到 FirebaseInAppMessaging 需要排除模块 'protobuf-lite'protolite-well-known-types 才能运行,因此它无法初始化,导致应用程序在启动时崩溃。

知道如何解决这个问题吗?

以下是我完整的 gradle 文件。当我从依赖项列表中排除 FirebaseInAppMessaging 并在包含它时开始给出错误时,该代码工作得很好。

    configurations 
        all 
            exclude group: 'commons-logging', module: 'commons-logging'
            exclude group: 'org.apache.httpcomponents'

            //implementation.exclude module:'protobuf-java'
            implementation.exclude module: 'protobuf-lite'
            implementation.exclude module:'protobuf-javalite'
            implementation.exclude module:'proto-google-common-protos'
        
    


dependencies 
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'com.google.firebase:firebase-core:17.2.3'
    implementation ('com.google.firebase:firebase-inappmessaging-display:19.0.3')
        exclude module: 'protolite-well-known-types'
    
    implementation 'com.google.firebase:firebase-messaging:20.1.2'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.google.firebase:firebase-auth:19.2.0'
    implementation 'com.google.firebase:firebase-database:19.2.1'
    implementation 'com.google.firebase:firebase-storage:19.1.1'
    implementation 'com.firebaseui:firebase-ui-database:6.2.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.google.firebase:firebase-analytics:17.2.3'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    implementation 'org.apache.commons:commons-lang3:3.5'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
    implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'

    //dialogflow v2 dependencies
    implementation 'com.google.cloud:google-cloud-dialogflow:0.120.2'
  //  implementation 'io.grpc:grpc-okhttp:1.27.0'

【问题讨论】:

这个问题你解决了吗? @SebastianRoth 我还没有解决它。仍在尝试找出问题可能是什么 这个兔子洞很深。似乎某些版本的 Protobuf 开始包含生成的文件,这现在导致了重复。我只能建议检查 Protobuf 的每个依赖项(来自您实际的应用程序依赖项)并尝试将传递依赖项版本提升到最新版本。因此,您将它们的依赖项复制到您的 build.grade 中并尝试将其升级到最新版本... @SebastianRoth 到目前为止,您找到解决此问题的任何方法了吗? @Razor 你找到解决方案了吗? 【参考方案1】:

像这样添加 firebase 依赖项:


implementation ("com.google.firebase:firebase-perf:19.0.8",
        // protobuf-lite that firebase depends on.
        exclude group: 'com.google.protobuf'
    )

【讨论】:

以上是关于解决 Firebase In App Messaging 和 Dialogflow 依赖项的主要内容,如果未能解决你的问题,请参考以下文章

在Ionic中实施Firebase In-App Messaging

iOS 14.5 App Tracking Transparency for firebase log in react-native app

使用 Firebase In App Messaging 插件时 Flutter 无法编译项目

Firebase SSO Auth 在 Facebook In App Browser 中不起作用

如何解决 Firebase:没有创建 Firebase App '[DEFAULT]' - 调用 Firebase App.initializeApp() (app/no-app)

TypeError:无法使用“in”运算符在未定义中搜索“$__firebase”