SwiftPM Dependency Crashes app on Release Build but not Debug

I added a SwiftPM package to my iOS app. The iOS app can use and call the library code fine in debug, but in release (for ad hoc and testflight), the app crashes as soon as it tries to access anything from the library. It prints something along the lines of "failed to demangle witness for associated type" The stack trace looks something like this:

0 libsystem_kernel.dylib 0x0000000189907ec4 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000189823774 pthread_kill$VARIANT$mp + 112
2 libsystem_c.dylib 0x0000000189777844 abort + 100
3 libswiftCore.dylib 0x0000000196ffda38 swift_vasprintf+ 2714168 (char**, char const*, char*) + 0
4 libswiftCore.dylib 0x000000019700c724 swift_getAssociatedTypeWitnessSlowImpl+ 2774820 (swift::MetadataRequest, swift::TargetWitnessTable<swift::InProcess>*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*, swift::TargetProtocolRequirement<swift::InProcess> const*) + 1308
5 libswiftCore.dylib 0x000000019700ab0c swift_getAssociatedTypeWitness + 176
6 DeviceLocator 0x00000001002bf3d8 static DeviceManagementAPI.updateDeviceInformation<A>(using:cookie:version:osVersion:model:pushToken:callback:) + 898008 (<compiler-generated>:0)


What am I missing?

Replies

Resolved this issue by setting "Dead Code Stripping" to "No". Not sure how much of a hack this is, but it works.