On Demand Resource Crash

When making an NSBundleResourceRequest to request resources, it works fine the first time. However, after calling endAccessingResources and making the request again, the app crashes when interacting with the page。

Xcode 15.0.1 (15A507) iPhone Xs 17.1.2

error prompt: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CoreUI: CGImageBlockSetRef __CUIImageProviderCopyImageBlockSetWithOptions(void *, CGImageProviderRef, CGRect, CGSize, CFDictionaryRef) unknown pixel format 0 rendition '(null)'' *** First throw call stack: (0x197258870 0x18f57fc00 0x1967c2e54 0x1b34532c4 0x198d46128 0x198d45f84 0x198d30134 0x198d3017c 0x198d30134 0x198d2fe00 0x198d2d54c 0x198d2cae4 0x198d37bf8 0x198d37434 0x198d20390 0x198d1fd28 0x198d061bc 0x198d053c0 0x199467ca0 0x199467c50 0x199466f94 0x199466e04 0x199466d30 0x19a5bbf80 0x1993fe200 0x1993fdc74 0x1993fdb90 0x1993fd708 0x1993fd580 0x1993fd288 0x1993fd21c 0x1993fea3c 0x1993fce8c 0x1993d1c68 0x1993d1990 0x1993fffdc 0x1993ffb58 0x1993ffaa4 0x1993c2694 0x1987d81c0 0x1987d7d48 0x1987de278 0x1987d7574 0x1987d721c 0x1971a1a2c 0x1971a0434 0x19719fb50 0x19719f668 0x1da56a5ec 0x1995bc2b4 0x1995bb8f0 0x100e2e454 0x1b9bf2dcc) libc++abi: terminating due to uncaught exception of type NSException *** Assertion failure in CGImageBlockSetRef __CUIImageProviderCopyImageBlockSetWithOptions(void *, CGImageProviderRef, CGRect, CGSize, CFDictionaryRef)(), CUIThemeRendition.m:1,328

CoreFoundation__exceptionPreprocess + 164 libobjc.A.dylibobjc_exception_throw + 60 Foundation-[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] CoreUI__csiCompressImageProviderCopyImageBlockSetWithOptions + 556 CoreGraphicssubImageProviderCopyImageBlockSet + 344 CoreGraphicsimageProvider_retain_data + 92 CoreGraphicsCGDataProviderRetainData + 80 CoreGraphicsprovider_for_destination_retain_data + 28 CoreGraphicsCGDataProviderRetainData + 80 CoreGraphicsCGAccessSessionCreate + 124 CoreGraphicsimg_data_lock + 2384 CoreGraphicsCGSImageDataLock + 1148 CoreGraphicsripc_AcquireRIPImageData + 848 CoreGraphicsripc_DrawImage + 832 CoreGraphicsCG::DisplayList::executeEntries(std::__1::__wrap_iter<std::__1::shared_ptr<CG::DisplayListEntry const>*>, std::__1::__wrap_iter<std::__1::shared_ptr<CG::DisplayListEntry const>*>, CGContextDelegate*, CGRenderingState*, CGGStack*, CGRect const*, __CFDictionary const*, bool) + 1172 CoreGraphicsCGDisplayListDrawInContextDelegate + 268 CoreGraphicsrip_auto_context_rasterization_loop + 1988 CoreGraphicsrip_auto_context_create_image + 56 UIKitCore-[UIGraphicsImageRendererContext currentImage] + 32 UIKitCore__44-[UIGraphicsImageRenderer imageWithActions:]_block_invoke + 28 UIKitCore-[UIGraphicsRenderer runDrawingActions:completionActions:format:error:] + 360 UIKitCore-[UIGraphicsRenderer runDrawingActions:completionActions:error:] + 92 UIKitCore-[UIGraphicsImageRenderer imageWithActions:] + 184 UIKitCore_UIInternalPreference_UIImageViewPreferredSymbolPixelAlignmentBehavior_block_invoke + 328 UIKitCore-[UIImageView _renditionForSource:size:symbolConfiguration:withRenditionResult:lazy:] + 1248 UIKitCore-[_UIImageContentContextualEffect _renditionWithRenditionResult:size:lazy:] + 116 UIKitCore-[_UIImageContent renditionWithSize:scale:applyingEffect:] + 1112 UIKitCore-[_UIImageContent renditionApplyingEffect:] + 80 UIKitCore-[_UIImageCGImageContent renditionApplyingEffect:] + 68 UIKitCore__61-[_UIImageContentLayout _prepareContentOfSize:source:target:]_block_invoke_2 + 36 UIKitCore-[_UIImageContentLayout _materializeRenditionContents] + 76 UIKitCore-[_UIImageContentLayout contents] + 24 UIKitCore-[UIImageView _applyImageLayout:toLayer:] + 884 UIKitCore-[UIImageView _setImageViewContents:] + 592 UIKitCore-[UIImageView _updateState] + 560 UIKitCore-[UIButtonLegacyVisualProvider _updateImageView] + 528 UIKitCore-[UIButtonLegacyVisualProvider layoutSubviews] + 116 UIKitCore-[UIButton layoutSubviews] + 40 UIKitCore-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1528 QuartzCoreCA::Layer::layout_if_needed(CA::Transaction*) + 500 QuartzCoreCA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144 QuartzCoreCA::Context::commit_transaction(CA::Transaction*, double, double*) + 464 QuartzCoreCA::Transaction::commit() + 648 QuartzCoreCA::Transaction::flush_as_runloop_observer(bool) + 88 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36 CoreFoundation__CFRunLoopDoObservers + 548 CoreFoundation__CFRunLoopRun + 1028 CoreFoundationCFRunLoopRunSpecific + 608 GraphicsServicesGSEventRunModal + 164 UIKitCore-[UIApplication _run] + 888 UIKitCoreUIApplicationMain + 340 MyAppmain + 100 at main.m:34:16 dyld`start + 2240

CoreFoundation`__exceptionPreprocess + 164
 libobjc.A.dylib`objc_exception_throw + 60
 Foundation`-[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:]
 CoreUI`__csiCompressImageProviderCopyImageBlockSetWithOptions + 556
 CoreGraphics`subImageProviderCopyImageBlockSet + 344
 CoreGraphics`imageProvider_retain_data + 92
 CoreGraphics`CGDataProviderRetainData + 80
 CoreGraphics`provider_for_destination_retain_data + 28
 CoreGraphics`CGDataProviderRetainData + 80
 CoreGraphics`CGAccessSessionCreate + 124
 CoreGraphics`img_data_lock + 2384
 CoreGraphics`CGSImageDataLock + 1148
 CoreGraphics`ripc_AcquireRIPImageData + 848
 CoreGraphics`ripc_DrawImage + 832
 CoreGraphics`CG::DisplayList::executeEntries(std::__1::__wrap_iter<std::__1::shared_ptr<CG::DisplayListEntry const>*>, std::__1::__wrap_iter<std::__1::shared_ptr<CG::DisplayListEntry const>*>, CGContextDelegate*, CGRenderingState*, CGGStack*, CGRect const*, __CFDictionary const*, bool) + 1172
 CoreGraphics`CGDisplayListDrawInContextDelegate + 268
 CoreGraphics`rip_auto_context_rasterization_loop + 1988
 CoreGraphics`rip_auto_context_create_image + 56
 UIKitCore`-[UIGraphicsImageRendererContext currentImage] + 32
 UIKitCore`__44-[UIGraphicsImageRenderer imageWithActions:]_block_invoke + 28
 UIKitCore`-[UIGraphicsRenderer runDrawingActions:completionActions:format:error:] + 360
 UIKitCore`-[UIGraphicsRenderer runDrawingActions:completionActions:error:] + 92
 UIKitCore`-[UIGraphicsImageRenderer imageWithActions:] + 184
 UIKitCore`_UIInternalPreference_UIImageViewPreferredSymbolPixelAlignmentBehavior_block_invoke + 328
 UIKitCore`-[UIImageView _renditionForSource:size:symbolConfiguration:withRenditionResult:lazy:] + 1248
 UIKitCore`-[_UIImageContentContextualEffect _renditionWithRenditionResult:size:lazy:] + 116
 UIKitCore`-[_UIImageContent renditionWithSize:scale:applyingEffect:] + 1112
 UIKitCore`-[_UIImageContent renditionApplyingEffect:] + 80
 UIKitCore`-[_UIImageCGImageContent renditionApplyingEffect:] + 68
 UIKitCore`__61-[_UIImageContentLayout _prepareContentOfSize:source:target:]_block_invoke_2 + 36
 UIKitCore`-[_UIImageContentLayout _materializeRenditionContents] + 76
 UIKitCore`-[_UIImageContentLayout contents] + 24
 UIKitCore`-[UIImageView _applyImageLayout:toLayer:] + 884
 UIKitCore`-[UIImageView _setImageViewContents:] + 592
 UIKitCore`-[UIImageView _updateState] + 560
 UIKitCore`-[UIButtonLegacyVisualProvider _updateImageView] + 528
 UIKitCore`-[UIButtonLegacyVisualProvider layoutSubviews] + 116
 UIKitCore`-[UIButton layoutSubviews] + 40
 UIKitCore`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1528
 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 500
 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144
 QuartzCore`CA::Context::commit_transaction(CA::Transaction*, double, double*) + 464
 QuartzCore`CA::Transaction::commit() + 648
 QuartzCore`CA::Transaction::flush_as_runloop_observer(bool) + 88
 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
 CoreFoundation`__CFRunLoopDoObservers + 548
 CoreFoundation`__CFRunLoopRun + 1028
 CoreFoundation`CFRunLoopRunSpecific + 608
 GraphicsServices`GSEventRunModal + 164
 UIKitCore`-[UIApplication _run] + 888
 UIKitCore`UIApplicationMain + 340
 Mico`main + 100 at main.m:34:16
 dyld`start + 2240
On Demand Resource Crash
 
 
Q