[Resolved] Crash in Analytics after sdk-exp response: -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil (since 2026-09-29 00:41 UTC)

· GitHub ·

1 min read Original article ↗

Description

Since 2026-09-29 00:41 UTC, our production iOS app has been crashing at a growing rate (56 crashes / 56 users in the first 18 minutes). We have not shipped an update. The crash started at the same time on 4 already-released builds.

Fatal Exception: NSInvalidArgumentException
*** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil

In every crash we checked (42/42), the crash happens right after the SDK receives the response to POST https://app-analytics-services.com/sdk-exp (HTTP 200). At the moment of the crash, APMExperimentWorkerQueue is still handling that response:

-[GULMutableDictionary dictionary]
-[APMEExperiment copyWithZone:]
-[APMESnapshot initWithSDKName:experiments:]
-[APMESnapshot initWithProtobuf:]
-[APMETaskManager experimentSnapshotsFromExperimentResponse:]
-[APMETaskManager handleFetchingExperimentsResponse:data:error:]
__35-[APMETaskManager fetchExperiments]_block_invoke

The crashing thread is only _dispatch_call_block_and_release -> -[__NSDictionaryM setObject:forKeyedSubscript:]. This matches GULMutableDictionary setObject:forKeyedSubscript:, which writes through dispatch_async and so drops the caller's frames.

It looks like the experiment payload being served since 00:41 UTC is parsed into a nil key. Please check the sdk-exp config and roll it back.

Reproducing the issue

Depends on the server response. Launch the app, the SDK fetches sdk-exp, and the app crashes less than 1 s later.

Firebase SDK Version

12.14.0

Xcode Version

26.5

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics

Targeted Platforms

iOS