Yesterday I got this crashed log running SwiftMessages on an iPhone 8 iOS11.1 in a Swift4 app.
Could you help me debug the issue?
Thanks a lot!
Exception Type: SIGABRT
Exception Codes: #0 at 0x192b3b014
Crashed Thread: 0
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SwiftMessages.MaskingView safeAreaInsets]: unrecognized selector sent to instance 0x111dcfb50'
Last Exception Backtrace:
0 CoreFoundation 0x0000000193b6d1b8 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x00000001925a455c objc_exception_throw + 52
2 CoreFoundation 0x0000000193b74268 -[NSObject(NSObject) doesNotRecognizeSelector:] + 136
3 CoreFoundation 0x0000000193b71270 ___forwarding___ + 912
4 CoreFoundation 0x0000000193a6a80c _CF_forwarding_prep_0 + 88
5 SwiftMessages 0x000000010109330c function signature specialization <Arg[0] = Owned To Guaranteed> of SwiftMessages.TopBottomAnimation.install(context: SwiftMessages.AnimationContext) -> () (TopBottomAnimation.swift:78)
6 SwiftMessages 0x00000001010929b4 protocol witness for SwiftMessages.Animator.show(context: SwiftMessages.AnimationContext, completion: (Swift.Bool) -> ()) -> () in conformance SwiftMessages.TopBottomAnimation : SwiftMessages.Animator in SwiftMessages (TopBottomAnimation.swift:0)
7 SwiftMessages 0x0000000101080d94 function signature specialization <Arg[0] = Owned To Guaranteed> of SwiftMessages.Presenter.show(completion: (Swift.Bool) -> ()) throws -> () (Presenter.swift:151)
8 SwiftMessages 0x000000010108d184 function signature specialization <Arg[0] = Owned To Guaranteed, Arg[1] = Owned To Guaranteed> of closure #1 () -> () in SwiftMessages.SwiftMessages.(dequeueNext in _AB28F0CA9BFF0B16E059C4C20EF9AFAA)() -> () (SwiftMessages.swift:0)
9 SwiftMessages 0x00000001010907f4 partial apply forwarder for closure #1 () -> () in SwiftMessages.SwiftMessages.(dequeueNext in _AB28F0CA9BFF0B16E059C4C20EF9AFAA)() -> () (SwiftMessages.swift:0)
10 SwiftMessages 0x0000000101081f5c reabstraction thunk helper from @callee_owned () -> () to @callee_unowned @convention(block) () -> () (SwiftMessages.swift:0)
11 libdispatch.dylib 0x00000001929f61fc _dispatch_call_block_and_release + 20
12 libdispatch.dylib 0x00000001929f61bc _dispatch_client_callout + 12
13 libdispatch.dylib 0x00000001929fad68 _dispatch_main_queue_callback_4CF + 996
14 CoreFoundation 0x0000000193b1a810 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
15 CoreFoundation 0x0000000193b183fc __CFRunLoopRun + 1656
16 CoreFoundation 0x0000000193a462b8 CFRunLoopRunSpecific + 440
17 GraphicsServices 0x00000001954fa198 GSEventRunModal + 176
18 UIKit 0x0000000199a8d7fc -[UIApplication _run] + 680
19 UIKit 0x0000000199a88534 UIApplicationMain + 204
20 mybigapp 0x000000010000dcf4 main (WebViewController.swift:8)
21 libdyld.dylib 0x0000000192a295b8 start + 0
Hi. I haven't seen this one before. SwiftMessages itself is referencing safeAreaInsets in a type-safe way, so I don't have any immediate theories to explain this error message:
'-[SwiftMessages.MaskingView safeAreaInsets]: unrecognized selector sent to instance
The greatest chance for success on this is if you can provide me with reproduction steps so I can look at it on my end. Can you attach a sample project that crashes consistently (maybe base on the SwiftMessages Demo project)? If not, you can try sending me copious code snippets from your app to give me an idea what it's doing.
Also, could you upgrade to SwiftMessages 4.1? From the stack trace, it looks like you're on an older version.
Hi, we were not able to reproduce this one ourselves, unfortunately.
By the first time this one appears, there was no new version of SwiftMessages available, will give now 4.1 a try and then report back, thanks a lot!
Haven't heard back. Closing
Similar crash in another project. Where for iOS 11 safeAreaInsets is unrecognised. But it happens 100% on Jalibroken devices
Got the same problem as @Igor-Palaguta , 100% crash on Jailbroken devices, would be very interested to know if someone has a lead on that
I stumbled upon this thread when looking for "safeAreaInsets crash jailbroken". I'm using safeAreaInsets.bottom in my code after checking for #available(iOS 11.0, *). In my case also all the crashes are from jailbroken devices. I believe you could fake your operating system version in jailbroken devices (https://yalujailbreak.net/lowerinstall/). My theory is that the crash occurs in jailbroken devices after trying to run unsupported APIs. For example the following will crash in a device which is pretending to be an iOS 11.
if #available(iOS 11.0, *) {
return safeAreaInsets.bottom
} else {
return 0
}
I don't support jailbroken phones.
Most helpful comment
Similar crash in another project. Where for iOS 11 safeAreaInsets is unrecognised. But it happens 100% on Jalibroken devices