SnapKit crash in iOS 11.0~11.1.2
New Issue Checklist
🚫 If this template is not filled out your issue will be closed with no comment. 🚫
- [x] I have looked at the Documentation
- [x] I have read the F.A.Q.
- [x] I have filled out this issue template.
Issue Info
| Info | Value |
|---|---|
| Platform | e.g. ios/osx/tvos |
| Platform Version | e.g. 11.0,11.1,11.1.2 |
| SnapKit Version | e.g. 4.0 |
| Integration Method | e.g. cocoapods |
Issue Description
I‘m using SnapKit like this. It crashes randomly in iOS 11.0、11.1、11.1.2
weak var weakSelf = self
operationView.snp.makeConstraints { (make) -> Void in
make.left.equalTo(weakSelf!.view)
make.right.equalTo(weakSelf!.view)
if #available(iOS 11.0, *) {
make.bottom.equalTo(weakSelf!.view.safeAreaLayoutGuide.snp.bottom)
} else {
// Fallback on earlier versions
make.bottom.equalTo(weakSelf!.view.snp.bottom)
}
make.height.equalTo(kOperatingViewHeight)
}
here's the error stack info
#0 Thread
NSInvalidArgumentException
-[UIView safeAreaLayoutGuide]: unrecognized selector sent to instance 0x1614269d0
CoreFoundation | _CFUserNotificationGetResponseValue + 148
-- | --
1 libobjc.A.dylib | objc_exception_throw + 56
2 CoreFoundation | -[NSTaggedPointerString lowercaseStringWithLocale:] + 420
3 CoreFoundation | ___CFLogCStringLegacy + 224
4 CoreFoundation | _CF_forwarding_prep_0 + 92
5 166 | __T07lottery27CPDigitalBaseViewControllerC15setupConstraitsyyFy7SnapKit15ConstraintMakerCcfU_Tf4gg_n (CPDigitalBaseViewController.swift:236)
6 166 | __T07lottery27CPDigitalBaseViewControllerC15setupConstraitsyyFy7SnapKit15ConstraintMakerCcfU_TA (CPDigitalBaseViewController.swift:0)
7 166 | makeConstraints (ConstraintMaker.swift:176)
8 166 | makeConstraints (ConstraintViewDSL.swift:0)
9 166| setupConstraits (CPDigitalBaseViewController.swift:0)
10 166 | setupConstraits (CPSDBaseVCtrl.swift:0)
11 166 | viewDidLoad (CPDigitalBaseViewController.swift:173)
12 166 | viewDidLoad (CPDigitalBaseViewController.swift:0)
13 166 | viewDidLoad (CPSDBaseVCtrl.swift:57)
14 166 | viewDidLoad (CPSDBaseVCtrl.swift:0)
15 166 | viewDidLoad (CPSSQVCtrl.swift:20)
16 UIKit | 0x00000001891bc000 + 85056
17 UIKit | 0x00000001891bc000 + 84036
18 166 | viewDidLoad (CPSwitchViewController.swift:95)
19 166| viewDidLoad (CPSwitchViewController.swift:0)
20 166 | viewDidLoad (CPSSQSwitchVCtrl.swift:0)
21 UIKit | 0x00000001891bc000 + 85056
22 UIKit | 0x00000001891bc000 + 184528
23 UIKit | 0x00000001891bc000 + 1867356
24 UIKit | 0x00000001891bc000 + 867904
25 UIKit | 0x00000001891bc000 + 867100
26 UIKit | 0x00000001891bc000 + 866948
27 UIKit | 0x00000001891bc000 + 66020
28 QuartzCore | 0x0000000186b50000 + 59796
29 QuartzCore | 0x0000000186b50000 + 38352
30 QuartzCore | 0x0000000186b50000 + 38032
31 QuartzCore | 0x0000000186b50000 + 35520
32 QuartzCore | 0x0000000186b50000 + 34848
33 UIKit | 0x00000001891bc000 + 77812
34 CoreFoundation | ___73-[_CFXPreferences(SearchListAdditions) replaceSearchList:withSearchList:]_block_invoke + 316
35 CoreFoundation | -[_CFXPreferences(SearchListAdditions) withSuiteSearchListForIdentifier:user:locked:perform:] + 28
36 CoreFoundation | -[CFPrefsSearchListSource deferredNotifyOfChangesFromDictionary:toDictionary:]+ 88
37 CoreFoundation | CFRunLoopRunSpecific + 384
38 GraphicsServices | GSEventRunModal + 180
39 UIKit | UIApplicationMain + 204
40 166 | main (AppDelegate.swift:45)
41 libdyld.dylib | 0x0000000183aec000 + 10424
+1
Any update on this issue? This crash occurs on us too and the devices are all running iOS 11.
Just chiming in here. I saw this issue on a project but it was only appearing on jailbroken phones (supposedly running iOS 11) for some reason.
I have a same case. Affects iOS 11 devices and some with iOS 12.
I'm also seeing this with iOS 12.
I have same problem but it was only appearing on jailbroken phones.
Any idea about this issue? We met some crashes online, it seems like only happened on iOS 12.x.