I have some crash in an iOS app, that only happens on iPad. Unfortunately I cannot reproduce the crash on my iPad, neither on any simulator. Let’s start with the stack trace of the crash:
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0xec69c __exceptionPreprocess
1 libobjc.A.dylib 0x2bc80 objc_exception_throw
2 Foundation 0x6b0dd8 _userInfoForFileAndLine
3 CoreUI 0x85a4c -[CUIMutableThemeRendition initWithCGImage:withDescription:forKey:]
4 CoreUI 0x5e85c -[CUIMutableStructuredThemeStore insertCGImage:withName:andDescription:]
5 UIKitCore 0xa11ea4 -[UIImageAsset _unsafe_registerImage:withConfiguration:]
6 UIKitCore 0xa11bf0 -[UIImageAsset _withLock_registerImage:withConfiguration:]
7 UIKitCore 0xa11b78 -[UIImageAsset _registerImage:withConfiguration:]
8 UIKitCore 0x31ff68 -[UIImage imageAsset]
9 SwiftUI 0x6e81dc OUTLINED_FUNCTION_1
10 SwiftUI 0x6e8aec OUTLINED_FUNCTION_1
11 SwiftUI 0xe35ca4 OUTLINED_FUNCTION_26
12 SwiftUI 0xf52ffc OUTLINED_FUNCTION_18
13 SwiftUI 0xe35ca4 OUTLINED_FUNCTION_26
14 SwiftUI 0xe3566c OUTLINED_FUNCTION_26
15 SwiftUI 0x66f098 __swift_destroy_boxed_opaque_existential_1Tm
16 AttributeGraph 0xb864 AG::Graph::UpdateStack::update()
17 AttributeGraph 0x2514 AG::Graph::update_attribute(AG::data::ptr<AG::Node>, unsigned int)
18 AttributeGraph 0xcf68 AG::Subgraph::update(unsigned int)
19 SwiftUI 0x179ba6c OUTLINED_FUNCTION_2
20 SwiftUI 0x179cf68 OUTLINED_FUNCTION_2
21 SwiftUI 0xe0daf8 OUTLINED_FUNCTION_15
22 SwiftUI 0x188740c OUTLINED_FUNCTION_2
23 SwiftUI 0x1885924 OUTLINED_FUNCTION_2
24 SwiftUI 0xe04ba4 OUTLINED_FUNCTION_15
25 SwiftUI 0x179cf30 OUTLINED_FUNCTION_2
26 SwiftUI 0x179ce1c OUTLINED_FUNCTION_2
27 SwiftUI 0x1160624 OUTLINED_FUNCTION_11
28 SwiftUI 0x753d80 OUTLINED_FUNCTION_4
29 SwiftUI 0x753cec OUTLINED_FUNCTION_4
30 SwiftUI 0x753e18 OUTLINED_FUNCTION_4
31 CoreFoundation 0x3583c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
32 CoreFoundation 0x34244 __CFRunLoopDoObservers
33 CoreFoundation 0x33960 __CFRunLoopRun
34 CoreFoundation 0x33478 CFRunLoopRunSpecific
35 GraphicsServices 0x34f8 GSEventRunModal
36 UIKitCore 0x22c62c -[UIApplication _run]
37 UIKitCore 0x22bc68 UIApplicationMain
38 SwiftUI 0x11664b8 OUTLINED_FUNCTION_31
39 SwiftUI 0x11662fc OUTLINED_FUNCTION_31
40 SwiftUI 0xdd6e90 OUTLINED_FUNCTION_26
41 Less Paper 0x80d0 main (PaperlessApp.swift)
42 ??? 0x1b6ecedcc (Missing)
The exception message is: scale must be > 0
What really surprises me is the origin in UIImageAsset. I don’t have any images in the asset catalogue except for the app icon. Searching the web for a similar crash did not bring up any useful results. I’m using Xcode 15.1 to compile the app. The app is some Multiplatform project, completely written in SwiftUI. As stated before, the app is not using any image assets, but it is using colours from the asset catalogue, and using SF Symbols, a lot.
Has anyone seen such a crash before? I’m so desperate, that I’ll soon try to make one release from Xcode 15.0.1, just to see if that makes a difference. Next desperate step would be to swizzle one of the methods in the stack trace and log some breadcrumbs to Crashlytics, to see if I can figure out what kind of asset this is. On iPhone this crash never happens by the way, it’s iPad only.




