You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NoSuchMethodError: DesugarCollections.synchronizedMap in release instrumentation tests with firebase-sessions 3.0.7 (BOM 34.x) #8600
Running Instrumentation tests with minify enabled release builds after updating to the 34.x from 33.x results into a NoSuchMethodError crash as soon as we launch the app in test environment.
Environment
Firebase BOM: 34.18.0
firebase-sessions: 3.0.7
firebase-crashlytics: 20.1.1
AGP: 8.13.2
desugar_jdk_libs: 2.1.5 (latest public)
testBuildType: release
minifyEnabled: true
Steps to reproduce:
Add firebase-crashlytics (or any lib that pulls in firebase-sessions) with BOM 34.x
Set minifyEnabled true in release build type
Set testBuildType "release" in android block
Set coreLibraryDesugaringEnabled true with desugar_jdk_libs:2.1.5
Run adb shell am instrument -w -r .test/androidx.test.runner.AndroidJUnitRunner
Expected: instrumentation test runs
Actual: process crashes immediately during FirebaseInitProvider.onCreate before any test runs -
java.lang.NoSuchMethodError: No static method synchronizedMap(Ljava/util/Map;)Ljava/util/Map;
in class Lj$/util/DesugarCollections; or its super classes
(declaration of 'j$.util.DesugarCollections' appears in <package>.test apk)
at CrashlyticsRegistrar.<clinit>
at FirebaseInitProvider.onCreate
firebase-sessions:3.0.7 calls DesugarCollections.synchronizedMap() which was compiled against an internal desugaring library that includes this method. In a normal release build this works because Firebase's bundled DesugarCollections (with synchronizedMap) is the only one present. In release instrumentation tests, the test APK brings its own DesugarCollections from the public desugar_jdk_libs:2.1.5 (which lacks synchronizedMap) and it shadows the main APK's version, causing the crash.
Relevant Code:
Attaching a minimal repro project to reproduce this issue.
Hi @shubham1g5, thank you for reaching out. I tried reproducing the issue with the MCVE you shared, however, I'm not getting the same error message as you shared.
However, let me consult this to our engineers and get back to you.
In the meantine, could you try to clean and invalidate the caches and see if the issue persists?
@lehcar09 The Process Crashed in your screenshot seems to be the bug reproducing — it's just that the crash occurs pre-test so it surfaces as an instrumentation runner failure rather than a test assertion failure.
Activity
lehcar09 commentedon Sep 18, 2026
Hi @shubham1g5, thank you for reaching out. I tried reproducing the issue with the MCVE you shared, however, I'm not getting the same error message as you shared.
However, let me consult this to our engineers and get back to you.
In the meantine, could you try to clean and invalidate the caches and see if the issue persists?
shubham1g5 commentedon Sep 21, 2026
@lehcar09 The
Process Crashedin your screenshot seems to be the bug reproducing — it's just that the crash occurs pre-test so it surfaces as an instrumentation runner failure rather than a test assertion failure.lehcar09 commentedon Sep 21, 2026
Thank you for clarifying @shubham1g5. I'll raise this to our engineers and see what we can do here. Thanks!