Description
[REQUIRED] Step 2: Describe your environment
Android Studio version: Electric Eel | 2022.1.1 Patch 1
Firebase Component: Firestore
Component version: 24.2.1 (BoM: 30.3.0)
[REQUIRED] Step 3: Describe the problem
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 it has a nested dependency.
com.google.firebase:protolite-well-known-types:18.0.0@aar
They have created a package with com.google.protobuf inside this module.
I cannot exclude this dependency, because it would result in same NoClassDefFoundError.