Starting with iOS 13.0, I've been seeing a new error showing up in my logs from users. The error is passed to the completion handler of NSBundleRequest.beginAccessingResources.
The error has the domain “AssetErrorDomain”, code 6, with an NSDebugDescription of “Asset URL has expired”. Not all users are encountering this issue, and I have been unable to reproduce it locally.
I don’t really understand what this error represents, how I should respond to it, or how users end up in this state. I’ve had one user report to me that deleting and reinstalling the app was the only way they were able to fix the issue.
Has anyone seen this issue in their own app?
Update
I filed a TSI with Apple, and they responded with the following:
I’ve been seeing this issue pop up for developers recently. We do not have a workaround at the moment, but we are working towards one.
I also filed a radar (FB7416830), and it's marked as having "Recent Similar Reports: More than 10". So it's clearly a widespread problem.
We started seeing this in our app with our most recent release. We are unable to duplicate it in Test Flight builds, however users have sent us screenshots with that exact error: “AssetErrorDomain”, code 6
The strange thing is we've had a number of releases over the past 6 months w/o issue and nothing has really changed with how we use the OnDemandResource API. A few theories we have are:
I may try the suggested work-a-round to version the tags. Is that still the best work-a-round you've found?
UPDATE
I was able to duplicate this in test flight using the following steps:
From inspecting the log it appears to update an ODR manifest but continues to use an old expired URL and accessKey to attempt to load the resource, resulting in AssetErrorDomain code 6 errors.
I resolved this by changing the tags, but not the bundle names. I'm pretty sure this was an effect of going from the Legacy Build System to the new one, though it could also have been an issue migrating to a newer version of XCode. I do see reference to an ODR fix in the XCode 12.3 release notes.
I am unable to duplicate the bug in 2 Test Flight builds going between to builds built with the same Build System and version of XCode (12.3). So, I think I'm good using the same tags going forward. Seems like there'd be a lot more noise about this bug if you weren't able to. A little unsettling though.
I also notice in Test Flight, it does not re-download an ODR between versions if you use the same bundle and tag name and it's already downloaded. That kinda seems like a bug to me too, but our bundles are pretty self contained so shouldn't effect my case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With