Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the iOS On Demand Resource error "Asset URL has expired" (AssetErrorDomain code 6) mean?

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.

like image 209
Chris Vasselli Avatar asked Dec 03 '25 00:12

Chris Vasselli


1 Answers

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:

  1. We did change from Legacy to the New XCode build system. I notice they package the asset packs a little differently
  2. So far all users that report it are using iOS 14.3. Perhaps the bug re-appeared in 14.3?
  3. We built this release using XCode 12. Previous releases were built with 11 and 10
  4. We noticed ENABLE_ON_DEMAND_RESOURCES is not set to YES. Perhaps this is the issue, though you would think they wouldn't work at all for that case. I haven't noticed this flag before, maybe it was added in XCode 12.
  5. Finally, we still support iOS 9

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:

  1. Install Test Flight Build A
  2. Load an ODR
  3. Install Test Flight Build B
  4. Wait 24 hours
  5. Attempt to Load another ODR

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.

like image 51
Rusty Avatar answered Dec 04 '25 14:12

Rusty



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!