Loading content from `.reality` file resulting in crash

Background

I have generated some content using Reality Composer and imported the resulting .rcproject file into my iOS application in Xcode. Xcode creates a .reality file that is then loaded onto the App bundle while also auto-generating code to streamline the interface with this file. load<scene name>() type method is an example of a useful method from the generated code, which returns the specified scene from the .reality file.

Observations

Invoking the above method synchronously results in the App crashing (and only signalling Thread <thread>: EXC_BREAKPOINT). The crash occurs at loadAnchor(contentsOf:withName:) within the load<scene name>() method. The documentation for this does state that the method "Blocks your app while loading an anchor entity from a file URL", but I don't see why this should result in a crash (I would anticipate unresponsive UI, and this is only if it's being run on the main thread to begin with).

Scheduling this operation on the main queue (via DispatchQueue or MainActor) overcomes the above issue. Placing the method within an unstructured Task does not result in a crash either, but scheduling it on a global queue results in a crash.

The above behaviour is observed during unit tests as well, but the use of an unstructured Tasks also results in a crash here.

Versions

While I've listed the respective versions below, I've also experienced this behaviour in prior versions.

  • Xcode 13.4.1
  • iOS 15.6

@ranveerm Can you please raise a ticket on Feedback Assistant and link your .reality file to it for our investigation? Please share your feedback ticket ID here.

As per @adarshpavani suggestion, I created a generic project to replicate this issue. Upon further inspection, I narrowed this behaviour down to situations when the scene is loaded from a background thread. I've submitted this feedback via Feedback Assistant and the Feedback ID is FB11183405.

Loading content from `.reality` file resulting in crash
 
 
Q