So yesterday I noticed that some of images in my app stopped appearing. All of them were placed in the on-demand resources, that is I've assigned tags to them. Up until yesterday they were working correctly but since then whenever I try to load the assets I get the error message saying:
Error Domain=NSCocoaErrorDomain Code=4099 "Connection invalidated to streaming unzip service."
My code for loading the asset is pretty straightforward and it was working perfectly fine before:
let resourceRequest = NSBundleResourceRequest(tags: ["vinyl"])
defer {
resourceRequest.endAccessingResources()
}
do {
if await !resourceRequest.conditionallyBeginAccessingResources() {
try await resourceRequest.beginAccessingResources()
}
} catch {
assertionFailure("Vinyl image was not available, error: \(error)")
}
I'm obviously using it in asynchronous context, but the old method which used completion handler gives me the same error. Has anyone encountered this issue as well? I just updated my devices to iOS 15.5, maybe that update broke on-demand resources?
Tested on Xcode 13.4, iOS 15.5