Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase crashlytics conflicting with firebase messaging #1001

Closed
mohsinnaqvi110 opened this issue Apr 28, 2020 · 4 comments
Closed

firebase crashlytics conflicting with firebase messaging #1001

mohsinnaqvi110 opened this issue Apr 28, 2020 · 4 comments

Comments

@mohsinnaqvi110
Copy link

After adding new firebase crashlytics, it shows a conflicting message with one signal.

implementation 'com.google.firebase:firebase-crashlytics:17.0.0'

Message is generic but it has some linkage with onesignal

Type com.google.firebase.iid.zzbb is referenced as an interface from com.google.firebase.messaging.zzf.

Anybody has idea?

@JT501
Copy link

JT501 commented Apr 29, 2020

Got the same issue.
I rollback to

// Google Analytics
implementation 'com.google.firebase:firebase-analytics:17.3.0'
// Crashlytics
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta04'

as a temporary workaround

@mohsinnaqvi110
Copy link
Author

I found the solution, after trying hard.

    implementation 'com.google.firebase:firebase-messaging:20.1.6'
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0'

And update the onesignal to whatever latest version is
oneSignalVersion = "3.13.2"

@rgomezp
Copy link
Contributor

rgomezp commented Apr 29, 2020

Howdy,
Likely you upgraded firebase and not OneSignal which is why you were seeing the issue. Upgrading OneSignal to the latest version is always a good idea :)

Enjoy!

@rgomezp rgomezp closed this as completed Apr 29, 2020
@jkasten2
Copy link
Member

jkasten2 commented Apr 30, 2020

firebase-iid Shared Dependency

The root issue is that firebase-crashlytics and firebase-messaging both depend on firebase-iid but at different versions. Gradle's default behavior to resolve this is to use the latest firebase-iid between the two, which makes sense. However in this case an older firebase-messaging is used in your project then firebase-iid will be upgraded to a version that no longer works firebase-messaging!

Specific Example of this issue

Example output from ./gradlew app:dependencies if com.google.firebase:firebase-messaging:20.0.0 and com.google.firebase:firebase-crashlytics:17.0.0 is used in your project.

+--- com.google.firebase:firebase-messaging:20.0.0
|    +--- com.google.firebase:firebase-iid:20.0.0 -> 20.1.5
...
+--- com.google.firebase:firebase-crashlytics:17.0.0
|    +--- com.google.firebase:firebase-iid:20.1.5 (*)

Note that com.google.firebase:firebase-messaging:20.0.0 stayed the same but under it com.google.firebase:firebase-iid:20.0.0 -> 20.1.5 was upgraded which causes this issue.

Root Issue

Gradle should really also upgrade the parent (firebase-messaging in this case) to a version that works with the child dependency that was upgraded from under it (firebase-iid in this case).
This gradle issue covers this Gradle dependency resolution issue and if addressed will resolve this issue and a lot of other similar issues like this:
gradle/gradle#10170

Current Solution

The current solution OneSignal offers is a Gradle plugin called OneSignal-Gradle-Plugin which does perform this automatic upgrade for parent dependencies if a child is updated. However the downside as this issue thread exists is that OneSignal has to maintain a white list of what is safe to upgrade.

OneSignal just released OneSignal-Gradle-Plugin 0.12.7 to cover this specific issue so making sure you have this plugin setup will auto resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants