我有一个项目,我同时使用 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'
代码编译成功,但应用程序在安装后立即崩溃。我做了一些研究并意识到排除模块'protobuf-lite'
或protolite-well-known-types
FirebaseInAppMessaging 需要运行,因此它无法初始化,从而导致应用程序在启动时崩溃。
知道如何解决这个问题吗?
下面是我完整的 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'
}