I'm using a selection of Firebase libraries together, so I'm using the BoM in order to ensure that the libraries will work together, here is my gradle.
implementation platform('com.google.firebase:firebase-bom:25.12.0')
implementation "com.google.firebase:firebase-messaging"
implementation "com.google.firebase:firebase-ml-vision"
implementation 'com.google.firebase:firebase-dynamic-links'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-installations'
implementation 'com.google.firebase:firebase-analytics'
Unfortunately, I'm getting errors such as this:
Duplicate class com.google.firebase.components.AbstractComponentContainer found in modules firebase-common-18.0.0-runtime.jar (com.google.firebase:firebase-common:18.0.0) and jetified-firebase-components-16.0.0-runtime.jar (com.google.firebase:firebase-components:16.0.0)
I can see the following "dependency" help from gradle:
com.google.firebase:firebase-common:16.0.3 -> 18.0.0
com.google.firebase:firebase-common:19.3.0 -> 18.0.0
And these dependencies only exist in the implementation
s above ^
com.google.firebase:firebase-components:16.0.0
is only here:
+--- com.google.firebase:firebase-config -> 19.2.0
| ...
| +--- com.google.firebase:firebase-installations:16.3.2
| | +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | +--- com.google.firebase:firebase-common:19.3.0 -> 18.0.0 (*)
| | +--- com.google.firebase:firebase-components:16.0.0
I get the feeling the problem may be being caused by jetifier but can't be sure.
I've tried removing both libraries completely but obviously they are used and therefore cause a crash at runtime.
I understood using the bom would protect me from library conflicts like this..? So I'm wondering if I'm missing something none-version related.