-
Notifications
You must be signed in to change notification settings - Fork 626
Description
Note this issue can only happen in apps that do not use the Firebase Android BoM to control library versioning.
An outdated dependency on firebase-common
causes an app to crash on launch if the app depends on any of the following libraries and versions (released February 09, 2023):
com.google.firebase:firebase-crashlytics:18.3.4
com.google.firebase:firebase-crashlytics-ktx:18.3.4
com.google.firebase:firebase-crashlytics-ndk:18.3.4
com.google.firebase:firebase-installations:17.1.1
com.google.firebase:firebase-installations-ktx:17.1.1
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/annotations/concurrent/Background
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.annotations.concurrent.Background"
This will be fixed in the next Firebase SDK release, which is being worked on now. Until that release is available, here are two workarounds:
-
Option 1: Depend on the Firebase Android BoM and drop the explicit version from the library. For example:
implementation platform('com.google.firebase:firebase-bom:31.2.1') implementation 'com.google.firebase:firebase-crashlytics'
This will allow the Firebase BoM to control library versioning. Note that using the Firebase BoM is the recommended way to control Firebase library versions.
-
Option 2: Add the current version of
firebase-common
as an explicit dependency. For example:implementation 'com.google.firebase:firebase-crashlytics:18.3.4' implementation 'com.google.firebase:firebase-common:20.3.0'
This will resolve the issue while still allowing explicit control of library versions.
Either of these workarounds will work for this release. We will post an update to this issue when the next release is available.