init MKMapView exception in Xcode 13.0 beta

Using the new version Xcode 13.0 beta, exception throws when init apple map view in Simulator

 self.mapView = MKMapView()

'NSInvalidArgumentException', reason: '-[MTLDebugDevice traceStream]: unrecognized selector sent to instance 0x7f946af781d0' *** First throw call stack: ( 0  CoreFoundation           0x00007fff203f6fa7 __exceptionPreprocess + 242 1  libobjc.A.dylib           0x00007fff2019cbe7 objc_exception_throw + 48 2  CoreFoundation           0x00007fff20405b28 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0 3  CoreFoundation           0x00007fff203fb46b forwarding + 1412 4  CoreFoundation           0x00007fff203fd598 _CF_forwarding_prep_0 + 120 5  libMTLCapture.dylib         0x0000000105f65a0e libMTLCapture.dylib + 55822 6  libMTLCapture.dylib         0x0000000105f6425d libMTLCapture.dylib + 49757 7  VectorKit              0x00007fff3181cf7d -[MetalLayer initWithDevice:sRGB:] + 73 8  VectorKit              0x00007fff30fcd059 _ZNK2md6Device8newLayerEv + 179 9  VectorKit              0x00007fff315cf63d -[MDDisplayLayer createRenderTarget] + 110 10 VectorKit              0x00007fff31015cf9 -[VKMapView _createDisplayLayer] + 36 11 VectorKit              0x00007fff3101c8b9 -[VKMapView initShouldRasterize:inBackground:contentScale:auditToken:mapViewPurpose:] + 1575 12 MapKit               0x00007fff30b08f22 -[MKBasicMapView initWithFrame:andGlobe:shouldRasterize:] + 408 13 MapKit               0x00007fff30a226ee -[MKMapView _commonInitFromIB:gestureRecognizerHostView:locationManager:showsAttribution:showsAppleLogo:] + 1601 14 MapKit               0x00007fff30a23448 -[MKMapView initWithFrame:] + 251 15 UIKitCore              0x00007fff254abce5 -[UIView init] + 44

libc++abi: terminating with uncaught exception of type NSException dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/jli1/Library/Developer/Xcode/DerivedData/erpclfvpzelgfubxbfquzihyqiou/Build/Products/Debug-iphonesimulator:/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMTLCapture.dylib

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MTLDebugDevice traceStream]: unrecognized selector sent to instance 0x7f946af781d0' terminating with uncaught exception of type NSException CoreSimulator 772.1 - Device: iPhone 12 Pro (E9648567-BCB1-4314-A315-3B0C8B142328) - Runtime: iOS 15.0 (19A5261u) - DeviceType: iPhone 12 Pro

Please file a report via Feedback Assistant (https://feedbackassistant.apple.com/), including a full crash log and a simple runnable project that demonstrates the issue.

I hit this same problem too. Mine is coming via a XIB not a direct object invocation

Same here with Xcode Version 13.0 (13A233).

Same issue here. Using react-native-maps library in a React Native project

Same issue.

Using react-native-maps library in a React Native project

having this issue as well

I am also having this problem, but with Objective C. [MKMapView new] - unrecognized selector sent to instance 

Bump. Same here when I just try to create CAMetalLayer or MTKView

Same issue

Same issue; I can add a detail for my case: the exception is fired the first time the app is launched in simulator or switching between different simulator (ie iPhone 13 and 12); in both cases for the subsequent runs the MkMapView is loaded correctly. Can I ask to all people in the thread if this exception occurs also on device? unfortunately I cannot test it on iPhone...

my configuration: Xcode 13.2.1 monterey 12.2

Ibid.

But with XC 13.2.1. And the mapView is built up in the storyboard, and not direct action on part of the my code.

And its very sporadic.

Same happening here.

Incident Identifier: 
Hardware Model:      iPhone10,3
Process:         
Path:            
Identifier:      
Version:         
Code Type:       ARM-64
Parent Process:   [1]

Date/Time:       2023-05-05 08:38:47 +0000
OS Version:      iPhone OS 15.0 (19A346)
Report Version:  104

Exception Type:  SIGSEGV
Exception Codes: SEGV_MAPERR at 0x10
Crashed Thread:  0

Thread 0 Crashed:
0   VectorKit                           0x00000001932a8048 0x193110000 + 1671240
1   VectorKit                           0x0000000193221154 0x193110000 + 1118548
2   VectorKit                           0x000000019323372c 0x193110000 + 1193772
3   VectorKit                           0x000000019321a5fc 0x193110000 + 1091068
4   VectorKit                           0x0000000193251044 0x193110000 + 1314884
5   VectorKit                           0x00000001931c8d9c 0x193110000 + 757148
6   VectorKit                           0x000000019322af44 0x193110000 + 1158980
7   VectorKit                           0x00000001933817f4 0x193110000 + 2562036
8   MapKit                              0x0000000192ee9df8 0x192dbb000 + 1240568
9   MapKit                              0x0000000192e29a10 0x192dbb000 + 453136
10  MapKit                              0x0000000192e01430 0x192dbb000 + 287792
11  MyApp                             0x0000000102c46734 @nonobjc MKMapView.init() + 8054580 (<compiler-generated>:0)
12  MyApp                             0x0000000102c4407c MKMapView.__allocating_init() + 8044668 (<compiler-generated>:0)
13  MyApp                             0x0000000102c43e78 closure #1 in GeofencingMapView.map.getter + 8044152 (GeofencingMapView.swift:116)
14  MyApp                             0x0000000102c41dbc GeofencingMapView.map.getter + 8035772 (GeofencingMapView.swift:114)
15  MyApp                             0x0000000102c41940 GeofencingMapView.init(frame:) + 8034624 (GeofencingMapView.swift:102)
16  MyApp                             0x0000000102c41a90 @objc GeofencingMapView.init(frame:) + 8034960 (<compiler-generated>:0)
17  MyApp                             0x0000000102c416a4 GeofencingMapView.__allocating_init(frame:) + 8033956 (GeofencingMapView.swift:0)
init MKMapView exception in Xcode 13.0 beta
 
 
Q