Resolve Firebase InApp Messasing and Dialogflow dependencies
Asked Answered
C

1

8

I have a project where I am using both FirebaseInAppMessaging and Dialogflow but I am having a hard time resolving the dependencies. After adding both FirebaseInAppMessaging and Dialogflow, I get the following error:

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.

Then if I exclude the dependencies as follows:

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

And I get the following errors:

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

I then proceeded by changing the excluding modules to

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

The code compiled successfully but the app crashed right after the installation. I did a bit of research and realized that the excluded module 'protobuf-lite' or protolite-well-known-types is required by FirebaseInAppMessaging to run and therefore it fails to initialise thus, causing the app to crash on startup.

Any idea how I can get around this issue?

Below is my complete gradle file. The code works just fine when I exclude FirebaseInAppMessaging from the list of my dependencies and start giving errors when I include it.

    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'
}
Chokedamp answered 10/3, 2020 at 13:7 Comment(6)
Did you solve this problem ?Charie
@SebastianRoth I have not yet solved it. Still trying to figure out what the issue could beChokedamp
The rabbit hole is deep on this one. It seems that Protobuf at some version started to include the generated files and this is now causing the duplication. I can only recommend to go through each dependency of Protobuf (from your actually app dependencies) and try to bump the transitive dependency version to the latest. So you copy their dependency into your build.grade and try to bump it to the latest version...Charie
@SebastianRoth Did you find any solution to this issue till now?Zacheryzack
@Chokedamp Did you find any solution yet?Zacheryzack
You'd think the firebase team would fix this issue if they wanted people to implement this product.Giess
K
-1

Add firebase dependencies like this:


implementation ("com.google.firebase:firebase-perf:19.0.8",{
        // protobuf-lite that firebase depends on.
        exclude group: 'com.google.protobuf'
    })
Kauai answered 5/9, 2020 at 6:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.