Defaults + Playgrounds iOS device crash repro
Summary
- This project reproduces a dyld crash on iOS devices when
Playgroundsis imported in the app target and the Defaults package is present. - The crash is due to
libLiveExecutionResultsLogger.dylibbeing linked into the app binary, which does not exist on device.
Repro Steps
- Open
DefaultsPlaygroundsRepro.xcodeprojin Xcode. - Select a physical iOS device.
- Build & run.
Expected
- App fails to launch on device with: dyld: Library not loaded: /usr/lib/swift/libLiveExecutionResultsLogger.dylib
Control Checks
- Comment out
import Playgroundsand the#Playground {}block inDefaultsPlaygroundsRepro/PlaygroundTest.swift→ app launches. - Remove Defaults package dependency → app launches.
Why This Repro Exists
- The Defaults parameter-pack overload of
Defaults.updatestriggers Swift runtime pack allocation symbols. - With Playgrounds present, those symbols resolve to
libLiveExecutionResultsLoggerduring linking. - That dylib is not present on iOS devices, so dyld fails at launch.
Key Files
DefaultsPlaygroundsRepro/PlaygroundTest.swift(Playgrounds import + #Playground)DefaultsPlaygroundsRepro/DefaultsKeys.swift(Defaults key)DefaultsPlaygroundsRepro/ContentView.swift(uses Defaults to ensure linking)