I'm trying to get my iOS app to work on Apple silicon Macs, but ODR (On-Demand Resources) don't seem to work. It seems like the Xcode doesn't even acknowledge existence of ODR in the project when run as an iOS app for Mac on my M1 MacBook Air.
I've created a very simple Xcode project to verify the issue, which only has a single image tagged as ODR. Checking the Disk tab in the Debug navigator, the ODR is shown correctly when running on a simulator:
...Yet when run as an iOS app for Mac it simply shows No Resources:
The beginAccessingResources(...)
call predictably fails, too, with the following error:
Error: Error Domain=AssetErrorDomain Code=7 "Invalid status code `404`" UserInfo={NSDebugDescription=Invalid status code `404`, NSUnderlyingError=0x600003fd5fb0 {Error Domain=AssetErrorDomain Code=1404 "(null)"}}
There are other messages in the console that could be related to the issue. The first thing the app logs when run as an iOS app for Mac, is this message repeated several times:
2022-01-20 12:14:41.566305+0000 ODRTest[29926:333135] [default] could not create original path for node <FSNode 0x600003191ca0> { isDir = ?, path = '/private/var/folders/kw/g_lttmtn0yx747mvzjmbksbc0000gn/X/FE0DB2BA-8F2D-5783-9BE1-891F8E117EC9/d/Wrapper/ODRTest.app' }, proceeding: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"
ODRTest is the name of the Xcode project I use to reproduce the issue. Nothing else is logged apart from these repeated messages and the ODR request error.
The documentation here seems to explicitly suggest that ODR should work fine, so I'm guessing this is some odd configuration error on my machine — perhaps related to file system access? I've tried updating macOS and re-installing Xcode to latest from scratch to no avail.
Anything else I'm missing here?