[iphonesimulator] Exception thrown during compile: Cannot get rkassets content for path /Documents/Apps/Example apps/VisionOS Examples/CreatingASpaceshipGame/Packages/Studio/Sources/Studio/Studio.rkassets because
I noticed that whenever I closed the Spaceship project, opened the Studio package on it own, selected "Trust and Open", then closed and reopened the Studio package on its own, I would often have to select "Trust and Open" again. This, combined with the error having to do with file permissions, gave me the suspicion that the issue had to do with the project being downloaded from the internet.
That “permission” message is almost always Xcode tripping over the macOS quarantine flag that’s automatically added to every file you download from the internet. When a RealityKit‑assets compiler meets a quarantined .rkassets bundle it refuses to read it and you get the cryptic error you’re seeing – even though the Finder shows that you own the file and have read/write access.
Fix (takes less than a minute)
- I had to move my project to my downloads folder. This removed spaces from the path which seemed to help.
- Quit Xcode (so it releases any handles on the files).
- Open Terminal and run this to recursively clear the quarantine flag on the whole sample project (swapping in the path to the project on your local machine):
| xattr -dr com.apple.quarantine \ |
| "Path/To/The/Project" |
xattr is the standard macOS tool for managing extended attributes;
the -d switch removes an attribute and -r does it recursively.
Only remove com.apple.quarantine for files that you trust.
- Re‑open the project in Xcode (my version is 16.3).
- Product ▸ Clean Build Folder (⇧⌘K) and build again.
- Also, it looks like the Spaceship app target did not have iOS 18 set as its minimum deployment to start with. It was set to 15.6. Set it to 18.
CheckWhat to do|
Path contains spaces or non‑ASCII characters (there’s a RealityKit bug in some betas) | Move the project to a simple path like ~/Dev/Spaceship/ and try again. |
// --- // | |
Actual POSIX permissions are wrong (rare) | chmod -R u+rwX,go+rX Studio.rkassets inside the Studio package. |
// --- // | |
iCloud/Dropbox/OneDrive holding the files offline | Make sure the project is on a local disk or force‑download everything first. |
// --- // | |
Old Xcode | The sample targets new RealityKit features that ship with Xcode 16 / 18; older versions fail at the asset‑compile stage. |
// --- // | |
| |
Gatekeeper sets the com.apple.quarantine attribute on every file extracted from a downloaded ZIP. For ordinary Swift files it does nothing, but the RealityKit asset compiler treats quarantined bundles as unreadable for security reasons and surfaces the generic “you don’t have permission” error instead of mentioning quarantine.
Once that attribute is removed (or you clone the project with git, which doesn’t propagate quarantine), the build pipeline can read .rkassets normally and Xcode proceeds past the compile‑assets phase.