App will build and run once; then crashes on phantom AVPlayerView reference every time

My application suddenly started crashing on launch when I target "My Mac - designed for iPad." But only after the first build from scratch, which runs once. All subsequent runs crash with:

dyld[90869]: Symbol not found: _OBJC_CLASS_$_AVPlayerView
  Referenced from: <D566512D-CAB4-3EA6-9B87-DBD15C6E71B3> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Debugger/libViewDebuggerSupport.dylib
  Expected in:     <4C34313C-03AD-32EB-8722-8A77C64AB959> /System/iOSSupport/System/Library/Frameworks/AVKit.framework/Versions/A/AVKit

I don't use AVPlayerView anywhere in my application. A file-contents search of the entire source tree doesn't turn it up either. The application doesn't even get to the point of instantiating the app object, so none of my code is involved.

If I switch the target to my iPhone, it will build and run repeatedly. If I then switch back to "My Mac," it will build and run once... and then crash every time.

Further research shows that this only happens in Debug builds.

This is a major issue right now because iOS 18 broke authentication certificates (thus HTTPS), so anyone writing or debugging an app that needs network functionality must use HTTP on localhost. In my case, I'm dead in the water because I can't debug on my local machine.

Has anyone seen something like this before? I can find no reference to anything like it.

Hello @Stoked, thank you for your post. Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include a test Xcode project, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Thanks for the reply. I have filed a report and attached a project to repro it. It's a big enough deal that I also started a paid support incident (so far I've only received confirmation).

Report is FB15492822. The incident case ID is 9640471

For anyone else with a similar problem:

This is apparently a known issue, although presumably the exact error message may differ. As a workaround, you can turn off view debugging. Thanks to Apple for providing this information while they investigate:

Select your target and click on "Edit Scheme...". Then, under Run (Debug) > Options > View Debugging, uncheck the "Enable user interface debugging" box.

App will build and run once; then crashes on phantom AVPlayerView reference every time
 
 
Q