MTKView is now available on visionOS but isn't working on visionOS 1.x

Hello!

I noticed that after WWDC 24 there was support added for MTKView in visionOS 1.0+. This is great! But when I use an MTKView in anything before visionOS 2.0 it doesn't work and the app ends up crashing.

Console error when running on a device that is on visionOS 1.2:

Symbol not found: _$s27_CompositorServices_SwiftUI0A5LayerV13configuration8rendererAcA0aE13Configuration_p_ySo019CP_OBJECT_cp_layer_G0CScMYcctcfC
Expected in:     <EFD973D2-97E1-380B-B89A-13CC3820B7F7> /System/Library/Frameworks/_CompositorServices_SwiftUI.framework/_CompositorServices_SwiftUI

Looks like MTKView may be using compositor services under the hood?

Any help would be great.

Thank you!

I'm getting this error on AVP visionOS 2.0, compiled with deployment targets 2.0 and 1.3 . Works on simulator.

Did you find a solution?

Nope. I just installed visionOS 2 beta on the device and I'm using Xcode 16 beta. And I no longer see that issue with that combo.

I just ran a visionOS 1.2 simulator that uses a MTKView with Xcode 16 beta 4 and it no longer crashes.

MTKView is now available on visionOS but isn't working on visionOS 1.x
 
 
Q