firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.26k stars 572 forks source link

Firebase Messaging 20.1.0 results in duplicate classes (Dagger) (Ref: 712) #1054

Closed ThomasSunderland closed 4 years ago

ThomasSunderland commented 4 years ago

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

After updating our app from Firebase Messaging version 20.0.1 to version 20.1.0 we are now receiving duplicate class errors regarding Dagger. Our app uses Dagger 1.2.5. This appears to be related the resolution of Issue 712.

Errors are as follows:

Steps to reproduce:

What happened? How can we make the problem occur?

Add Dagger 1.2.5 and Firebase Messaging 20.1.0 dependencies to your app

google-oss-bot commented 4 years ago

I found a few problems with this issue:

aguatno commented 4 years ago

Thank you for reporting the issue @ThomasSunderland. Can you share your dependencies from the build.gradle file?

ThomasSunderland commented 4 years ago

@aguatno

We have about 10 modules in our solution (it is quite large), but the dependencies of concern I think are below. Thanks!

    // dependency injection (dagger)
    // Ref: http://square.github.io/dagger/
    implementation "com.squareup.dagger:dagger:1.2.5"
    annotationProcessor "com.squareup.dagger:dagger-compiler:1.2.5"

    // firebase messaging (required for supporting SNS over FCM)
    // note: do not update, causes clash with Dagger
    // ref: https://github.com/firebase/firebase-android-sdk/issues/1054
    implementation 'com.google.firebase:firebase-messaging:20.0.1'
aguatno commented 4 years ago

Thanks @ThomasSunderland I was able to reproduce the issue. I'll forward this information to the team. I'll be reaching out to you as soon as any information becomes available.

aguatno commented 4 years ago

Hi @ThomasSunderland thanks for patiently waiting. Upon checking, it seems there's an incompatibility between the latest SDK and Dagger1. You could solve this by migrating to Dagger2 or use of Dagger1 (using something like https://code.google.com/archive/p/jarjar/). Currently, It's unlikely the team is going to switch away from Dagger2, though.

aguatno commented 4 years ago

I'm going to close this issue for now. In case you want to continue the discussion just leave a comment here and we are happy to re-open this.

tfcporciuncula commented 4 years ago

@aguatno Dropping support to users stuck with Dagger 1 is a big deal, and I think this could at least be communicated in the release notes. Migrating from Dagger 1 to Dagger 2 is a huge project, but I'm not sure what you meant by:

or use of Dagger1 (using something like https://code.google.com/archive/p/jarjar/)

Would you mind going in details about this?

paulblessing commented 4 years ago

My company also ran into this. We have a large app that's pretty locked in to Dagger 1 for the foreseeable future.