On an iPhone running iOS 26 beta 5, url(for: FilePath("subdir/asset.mov")) most always throws this error:
The URL for “subdir/asset.mov” couldn’t be retrieved: “asset.mov” couldn’t be copied to “subdir” because an item with the same name already exists.
Yet, contents(at: FilePath("subdir/asset.mov")) always returns Data for a playable AVMovie.
How can I avoid this url(for:)
error?
The asset pack in question is downloaded. The error persists even after pack deletion, redownload, relaunch, and combinations of that.
// Assets repo root
subdir.aar
subdir/asset.mov
subdir/asset_thumb.heic
subdir/Manifest.json
// Manifest.json
{
"assetPackID": "subdir",
"downloadPolicy": {
"onDemand": {}
},
"fileSelectors": [
{
"directory": "subdir",
},
],
"platforms": [
"iOS",
"visionOS"
]
}
xcrun ba-package subdir/Manifest.json -o subdir.aar
xcrun ba-serve --host 192.168.0.10 -p 443 subdir.aar
This looks like a bug on our side. Could you file a feedback report and reply to this thread with the feedback ID? Make sure to file the feedback report using the Feedback Assistant app on your development iPhone. Thanks!
A potential workaround is to pass just "subdir"
to url(for:)
and then to append "asset.mov"
to the returned URL. url(for:)
uses different logic for resolving directories compared to individual files, so until we have a fix available, you might be able to bypass the bug by triggering the directory-resolution logic instead of the file-resolution logic. Let me know if that works for you! (Note that this potential workaround is speculative at this point; we’ll need to look at a feedback report to confirm the underlying problem.)