Ошибка в зависимостях после обновления firebase-messaging до версии 22.0.0
Обновил библиотеку Firebase Messaging с 21.1.0 до 22.0.0 и получаю с десяток одинаковых ошибок:
Duplicate class com.google.android.gms.internal.firebase_messaging.zza found in modules jetified-firebase-iid-19.0.0-runtime (com.google.firebase:firebase-iid:19.0.0) and jetified-firebase-messaging-22.0.0-runtime (com.google.firebase:firebase-messaging:22.0.
Что случилось и что нужно делать? В release-notes написано так:
Cloud Messaging version 22.0.0 Removed dependency on the deprecated Firebase Instance ID SDK.
Caution: This is a breaking change for apps that use FCM and the deprecated Firebase Instance ID API to manage registration tokens. We strongly recommend migrating to FCM's token APIs. If you're unable to migrate to the replacement APIs, add a direct dependency on the firebase-iid library to your build.gradle file.
Но я не знаю ни о каком IID, у меня его нет в проекте. Вот библиотеки firebase, которые есть в проекте:
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-config:21.0.0'
implementation 'com.google.firebase:firebase-datatransport:18.0.0'
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
implementation "com.google.firebase:firebase-analytics:17.3.0"
implementation "com.google.firebase:firebase-dynamic-links-ktx:19.1.1"
implementation "com.google.firebase:firebase-crashlytics:17.3.1"
implementation "com.google.firebase:firebase-core:18.0.2"
implementation "com.google.firebase:firebase-ml-model-interpreter:19.0.0"
implementation "com.google.firebase:firebase-firestore:22.0.2"
implementation "com.google.firebase:firebase-auth:20.0.2"
implementation 'com.google.firebase:firebase-ml-vision:21.0.0'
Очень часто по всему stackoverflow (в том числе и англоязычном) я натыкаюсь на подобные вопросы, причем ответы на них всегда по типу "обнови/понизь версию той или иной либы", расскажите, как победить мою ошибку и как ориентироваться в этой файрбейз-каше. Возможно, у меня несовместимости вообще
Ответы (1 шт):
ПОпробуйте как сказано в ошибке явно добвить эту либу:
implementation "com.google.firebase:firebase-iid:21.1.0"