VisionOS 2 Beta crash - doesNotRecognizeSelector plane

In Xcode 16 beta 1 and 3, when running a VisionOS 2 simulator on an SwiftUI app that ran successfully in VisionOS 1, I received the following crash at startup:

Thread 1: "*** -[NSProxy doesNotRecognizeSelector:plane] called!"

I've gone through my code attempting to find any references to a plane method, but I have no such calls in my code, leading me to suspect that this is somehow related to VisionOS beta simulator code. Has anyone else run into this bug and worked around it somehow?

I've temporarily worked around this issue by adding an ObjC extension to NSProxy:

@interface NSProxy (Plane)

-(id) plane;

@end

@implementation NSProxy (Plane)

-(id) plane {
    return nil;
}

@end

which allows the app to continue initializing as normal. While breakpointing in that shim code, I also found the suspect caller in the breakpoint:

I'm not quite sure what MRUIPlacementTargetFromAnchoringTarget is, and also, I do not currently have any anchors in my RealityView scene, so I suspect there might be some expectation that my older code is not meeting?

Hopefully if this is a new expectation, that future exceptions might be a bit more self explanatory about what is required on behalf of the application.

I've been running into the same problem on an actual Vision Pro device during app launch. I've just updated to the latest Beta 5 (22N5297g) but it's still reproducible.

Adding the Objective-C category on NSProxy seems to help. 🙏

VisionOS 2 Beta crash - doesNotRecognizeSelector plane
 
 
Q