New onset Metal Validation failure

I have an older App using SpriteKit and have updated to Xcode 14.3. Compilation and linking is ok.

App never gets to my code but crashes in AppDelegate with:

Metal API Validation Enabled
-[MTLDebugDevice newLibraryWithURL:error:]:2250: failed assertion `url must not be nil.'

I do not anywhere explicitly init() or call Metal. Using LLDB at the point of crash, I tried to peek into the App Bundle but

po Bundle.main.paths(forResourcesOfType: "URL", inDirectory: "nil")
0 elements

likewise:

po Bundle.main.paths(forResourcesOfType: "*", inDirectory: "nil")
0 elements

I suspect a build script or preformed bundle.main got screwed up, but I do not know how to investigate.

I should that this seems to be isolated to one MacBook Pro, compiles and runs fine on an iMac!

Any thoughts?

Replies

Hi Aviametrix

Are you using the final release version of Xcode 14.3 or one of the betas? This was a bug in the simulators that shipped with the early Xcode 14.3 betas but should be resolved in the release version.

Further investigation revealed that this bug was only found in a single simulator (iPhone 14 Pro running 16.4) on a single laptop (MacBook Pro 16” 2021) running the release 13.4 Xcode.

Since this was a standard baseline Sim for this release of Xcode, I could not figure out how to delete and replace it. The path of least investment and resistance was simply to delete Xcode and reload.

my final assessment: a corrupted Sim module. Why it got corrupted is unknown.

I also got the error -[MTLDebugDevice newLibraryWithURL:error:]:2250: failed assertion `url must not be nil.' My version of Xcode is 14.3, I used Simulator iOS 16.2. The error went away when I started using Simulator iOS 16.4.