导出mac版本直接运行报错

  • Creator 版本:3.8 mac版

  • 目标平台: macos

  • 重现方式:导出mac空项目,配置都默认,勾选了support apple silicon

  • 首个报错:
    2023-09-13 16:06:57.104410+0800 ais[10719:356676] [General] -[NVMTLDevice supportsSparseDepthAttachments]: unrecognized selector sent to instance 0x7fb267a87000
    2023-09-13 16:06:57.104659+0800 ais[10719:356676] [General] (
    0 CoreFoundation 0x00007ff812bdc773 __exceptionPreprocess + 242
    1 libobjc.A.dylib 0x00007ff81293cbc3 objc_exception_throw + 48
    2 CoreFoundation 0x00007ff812c6135b -[NSObject(NSObject) __retain_OA] + 0
    3 CoreFoundation 0x00007ff812b432f8 forwarding + 751
    4 CoreFoundation 0x00007ff812b42f78 _CF_forwarding_prep_0 + 120
    5 MetalTools 0x00007ff813296341 ZL28validateRenderPassDescriptorP31MTLRenderPassDescriptorInternalPU19objcproto9MTLDevice11objc_objectRNSt3__118unordered_multisetI26AttachmentDescriptorSimpleNS5_6hash_tENS5_7equal_tENS3_9allocatorIS5_EEEERNS3_5arrayIS5_Lm8EEESE + 3348
    6 MetalTools 0x00007ff813295522 -[MTLDebugCommandBuffer renderCommandEncoderWithDescriptor:] + 255
    7 libMTLCapture.dylib 0x0000000118f7807b DYMTLWrapDeviceWithDebugLayer + 220442
    8 ais 0x000000010ecef3d1 _ZN2cc3gfx25CCMTLRenderCommandEncoder10initializeEPU27objcproto16MTLCommandBuffer11objc_objectP23MTLRenderPassDescriptor + 49
    9 ais 0x000000010ecee316 _ZN2cc3gfx18CCMTLCommandBuffer15beginRenderPassEPNS0_10RenderPassEPNS0_11FramebufferERKNS0_4RectEPKNS0_5ColorEfjPKPNS0_13CommandBufferEj + 5206
    10 ais 0x000000010ec714c7 _ZZN2cc3gfx18CommandBufferAgent15beginRenderPassEPNS0_10RenderPassEPNS0_11FramebufferERKNS0_4RectEPKNS0_5ColorEfjPKPNS0_13CommandBufferEjEN28CommandBufferBeginRenderPass7executeEv + 71
    11 ais 0x000000010e567f26 _ZN2cc12MessageQueue15executeMessagesEv + 54
    12 ais 0x000000010e567f83 _ZN2cc12MessageQueue13flushMessagesEv + 51
    13 ais 0x000000010ec6ff64 _ZN2cc3gfx18CommandBufferAgent13flushCommandsEjPKPS1_b + 52
    14 ais 0x000000010ec82404 _ZZN2cc3gfx11DeviceAgent13flushCommandsEPKPNS0_13CommandBufferEjEN19DeviceFlushCommands7executeEv + 36
    15 ais 0x000000010e567f26 _ZN2cc12MessageQueue15executeMessagesEv + 54
    16 ais 0x000000010e567f83 _ZN2cc12MessageQueue13flushMessagesEv + 51
    17 ais 0x000000010e5677e1 _ZN2cc12MessageQueue18consumerThreadLoopEv + 65
    18 ais 0x000000010e56ff19 ZNSt3__1L8__invokeIMN2cc12MessageQueueEDoFvvEPS2_JEvEEDTcldsdescT0_fp0_fp_spscT1_fp1_EEOT_OS6_DpOS7 + 105
    19 ais 0x000000010e56fe5e _ZNSt3__1L16__thread_executeINS_10unique_ptrINS_15__thread_structENS_14default_deleteIS2_EEEEMN2cc12MessageQueueEDoFvvEJPS7_EJLm2EEEEvRNS_5tupleIJT_T0_DpT1_EEENS_15__tuple_indicesIJXspT2_EEEE + 62
    20 ais 0x000000010e56f652 ZNSt3__1L14__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEMN2cc12MessageQueueEDoFvvEPS8_EEEEEPvSD + 98
    21 libsystem_pthread.dylib 0x0000000118955c0d _pthread_start + 125
    22 libsystem_pthread.dylib 0x000000011895dccf thread_start + 15
    )
    libc++abi: terminating with uncaught exception of type NSException
    *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NVMTLDevice supportsSparseDepthAttachments]: unrecognized selector sent to instance 0x7fb267a87000’
    terminating with uncaught exception of type NSException

  • 编辑器操作系统: macos 12.6,xcode 14.2

  • 重现概率:必现

如上。

找了一圈解决方案,最后取消了edit schema -> run -> metal api validation居然可以跑起来了……

感谢分享~~