I am using firebase with the following dependencies
implementation (platform('com.google.firebase:firebase-bom:30.3.0'))
implementation ('com.google.firebase:firebase-analytics-ktx')
implementation ('com.google.firebase:firebase-messaging-ktx')
implementation ('com.google.firebase:firebase-firestore-ktx')
implementation ('com.google.firebase:firebase-perf-ktx')
I have created a SDK which uses protobuf java. Since the firebase uses protobuf java lite. It results in duplicate class exception.
I cannot exclude protobuf from my SDK dependency because that would cause a
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/protobuf/GeneratedMessageV3; exception.
If I exclude protobuf from firebase. It still shows duplicate class exception because of
com.google.firebase:protolite-well-known-types:18.0.0@aar
I cannot exclude this dependency, because I am afraid it would result in same NoClassDefFoundError.
Is there any way to avoid Duplicate Class Exception without any crash?