Xcode Cloud builds don't work with *.usdz files in a RealityComposer package

In courses like Compose interactive 3D content in Reality Composer Pro Realitykit Engineers recommended working with Reality Composer Pro to create RealityKit packages to embed in our Realitykit Xcode projects.

And, comparing the workflow to Unity/Unreal, I can see the reasoning since it is nice to prepare scenes/materials/assets visually.

Now when we also want to run a Xcode Cloud CI/CD pipeline this seems to come into conflict: When adding a basic *.usdz to the RealityKitContent.rkassets folder, every build we run on Xcode cloud fails with:

Compile Reality Asset RealityKitContent.rkassets
  ❌realitytool requires Metal for this operation and it is not available in this build environment

I have also found this related forum post here but it was specifically about compiling a *.skybox.

Steps to reproduce:

  1. create default Xcode ARKit RealityKit template app
  2. open Reality Composer Pro, create new project, choose a folder somewhere in the above created app
  3. add RealityKitContent as dependency under Frameworks, Libraries, and Embedded Content
  4. drag the example Usdz into the reality composer project, maybe add it to base scene
  5. setup Xcode cloud basic build

Result would be the above error. Additionally it always takes > 2min to fail:

If I remove the *.usdz file it works (so it's not like the metal toolchain isn't installed or realitytool not working)

Here's the example file, I shared it via dropbox since I can't attach usdz's here. It's just the monkey head from blender exported as usdz and crushed using usdcrush https://www.dropbox.com/scl/fi/f7b7dsyspby1zabk26932/monkey_crushed.usdz?rlkey=feilrul7gx6naxkbun7oaezv0&st=8afj5ewt&dl=0

PS: Is anyone aware of a way how we could run realitytool maybe as a buildstep locally, check in the result? This way xcodebuild on the server could just use the prebuild artifact?

Ok, so as a workaround, we can remove all the *.usdz's from the RealityContent rkassets folder (and import them using Entity(named: from the main bundle).

But then , for the remaining 50kb of RealityContent.rkassets folder with a few shader graph materials, we get many minutes of build time 😳

FB20393133 FB20391629

Xcode Cloud builds don't work with *.usdz files in a RealityComposer package
 
 
Q