On-demand resources suddenly stopped working?

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

Post not yet marked as solved Up vote post of wiencheck Down vote post of wiencheck
167 views

Replies

Hi! Did you manage to solve this issue? For me it was working fine last Friday but today that I ran my app my ODR suddenly stopped working and got that message.