2

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 implementations 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.

4
  • You should post an issue on GitHub with your full, minimal configuration that reproduces the issue. github.com/firebase/firebase-android-sdk Commented Oct 23, 2020 at 14:47
  • 1
    did you solve it? Commented Jan 28, 2021 at 13:19
  • 1
    Any update on this? I am getting the same issue with OneSignal Plugin. Commented Aug 4, 2021 at 13:11
  • Sorry, I switched jobs so never solved this. I ended up manually adding all versioned components until it worked (suboptimal for sure!)
    – Graeme
    Commented Aug 6, 2021 at 16:00

1 Answer 1

0
  1. add these lines to android > app > build.gradle

    implementation 'com.google.firebase:firebase-core:17.3.0'

    implementation 'com.google.firebase:firebase-messaging:20.1.5'

  2. cd android > .gradlew clean

  3. cd .. > npm start -reset-cache

check now 😋

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.