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?
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
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"
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!
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!
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.
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:
https://github.com/gradle/gradle/issues/10170
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.
Most helpful comment
firebase-iid Shared Dependency
The root issue is that
firebase-crashlyticsandfirebase-messagingboth depend onfirebase-iidbut at different versions. Gradle's default behavior to resolve this is to use the latestfirebase-iidbetween the two, which makes sense. However in this case an olderfirebase-messagingis used in your project thenfirebase-iidwill be upgraded to a version that no longer worksfirebase-messaging!Specific Example of this issue
Example output from
./gradlew app:dependenciesifcom.google.firebase:firebase-messaging:20.0.0andcom.google.firebase:firebase-crashlytics:17.0.0is used in your project.Note that
com.google.firebase:firebase-messaging:20.0.0stayed the same but under itcom.google.firebase:firebase-iid:20.0.0 -> 20.1.5was upgraded which causes this issue.Root Issue
Gradle should really also upgrade the parent (
firebase-messagingin this case) to a version that works with the child dependency that was upgraded from under it (firebase-iidin 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:
https://github.com/gradle/gradle/issues/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.