Xcode 15.0 built app crashes during launch on iOS 16.6.1

I have an iOS app that runs fine on iOS 17.0.2 but crashes on iOS 16.6.1 with the following error. I did not have this issue with older version of Xcode.

I have attached the crashlog.

This is what I see in the Xcode debug window.

  Referenced from: <19E02EF7-C05C-3D62-88DC-AC4178A604FA> /private/var/containers/Bundle/Application/796C1BB8-A5DE-40A1-A9F3-41E6B4EAE380/xxxxxxxxxwood.app/xxxxxxxxxwood
  Expected in:     <E0BB294E-B630-379B-AAC8-D5C0A83A55E6> /usr/lib/swift/libswiftDispatch.dylib

My Xcode version is Version 15.0 (15A240d)

Answered by sameergb in 768076022

My issue was resolved after I change

private static let queue = DispatchSerialQueue(label: "com.greenwood.imageLoaderURLProtocol")

to

private static let queue = DispatchQueue(label: "com.greenwood.imageLoaderURLProtocol")

I would have expected the compiler to give error regarding DispatchSerialQueue not being available prior to iOS 17.0....

This code was adapted from the Apple sample code, which Xcode helped to update for Xcode 15....

dyld[26192]: Symbol not found: _$sSo24OS_dispatch_queue_serialC8DispatchE5label3qos10attributes20autoreleaseFrequency6targetABSS_AC0E3QoSVAbCE10AttributesVSo0a1_b1_C0CACE011AutoreleaseJ0OANSgtcfC Referenced from: <19E02EF7-C05C-3D62-88DC-AC4178A604FA> /private/var/containers/Bundle/Application/DBC3A9EB-A8F8-4AA4-B72C-C4C59D7C2B4E/Bank Greenwood.app/Bank Greenwood Expected in: <E0BB294E-B630-379B-AAC8-D5C0A83A55E6> /usr/lib/swift/libswiftDispatch.dylib

What iOS SDK version are you targeting?

TSI Case-ID: 4394375

I met the same issue when my macos's version is 13.6. After I upgrade macos to 14.0 (23A344), it solved.

Accepted Answer

My issue was resolved after I change

private static let queue = DispatchSerialQueue(label: "com.greenwood.imageLoaderURLProtocol")

to

private static let queue = DispatchQueue(label: "com.greenwood.imageLoaderURLProtocol")

I would have expected the compiler to give error regarding DispatchSerialQueue not being available prior to iOS 17.0....

This code was adapted from the Apple sample code, which Xcode helped to update for Xcode 15....

Xcode 15.0 built app crashes during launch on iOS 16.6.1
 
 
Q