SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.31k stars 743 forks source link

Main Thread Checker: UI API called on a background thread: -[UIView initWithCoder:] #311

Closed beilusen closed 5 years ago

beilusen commented 5 years ago

Main Thread Checker: UI API called on a background thread: -[UIView initWithCoder:] PID: 622, TID: 189070, Thread name: AVAudioSession Notify Thread, Queue name: com.apple.root.default-qos.overcommit, QoS: 21 Backtrace: 4 SwiftMessages 0x00000001093a5410 $s13SwiftMessages8BaseViewC5coderACSgSo7NSCoderC_tcfc + 1204 5 SwiftMessages 0x00000001093a5628 $s13SwiftMessages8BaseViewC5coderACSgSo7NSCoderC_tcfcTo + 56 6 SwiftMessages 0x00000001093b9318 $s13SwiftMessages11MessageViewC5coderACSgSo7NSCoderC_tcfc + 704 7 SwiftMessages 0x00000001093b93cc $s13SwiftMessages11MessageViewC5coderACSgSo7NSCoderC_tcfcTo + 56 8 UIKit 0x000000018c1edfec + 248 9 UIKit 0x000000018c34f738 + 688 10 UIKit 0x000000018c34f470 + 312 11 UIKit 0x000000018c1edc60 + 136 12 UIKit 0x000000018c34f738 + 688 13 UIKit 0x000000018c34f8b0 + 1064 14 UIKit 0x000000018c34f470 + 312 15 UIKit 0x000000018c1ecfe4 + 1164 16 UIKit 0x000000018c1f2c18 + 224 17 SwiftMessages 0x00000001093e3bac $s13SwiftMessagesAAC19internalViewFromNib33_AB28F0CA9BFF0B16E059C4C20EF9AFAALL5named6bundle10filesOwnerxSS_So8NSBundleCSgyXltKSo6UIViewCRbzlFZ + 948 18 SwiftMessages 0x00000001093e3fcc $s13SwiftMessagesAAC11viewFromNib5named10filesOwnerxSS_yXltKSo6UIViewCRbzlFZ + 96 19 SwiftMessages 0x00000001093ba264 $s13SwiftMessages11MessageViewC11viewFromNib6layout10filesOwnerxAC6LayoutO_yXltACRbzlFZ + 180 20 AIPowerSwift 0x0000000104681fbc $s12AIPowerSwift16AKLSActivityViewC09showBlackb7MessageD0_8bodyTextySS_SStFZ + 360 21 AIPowerSwift 0x0000000104682ffc $s12AIPowerSwift16AKLSActivityViewC011showWarningb7MessageD0_8bodyTextySS_SStFZ + 216 22 AIPowerSwift 0x00000001047146b4 $s12AIPowerSwift27AKLSMainEquipmentScanListVCC24carchargetBluetoothState6manage03bleJ0yAA0cd10CarChargetI6ManageC_So03lp_L6_stateatF + 2196 23 AIPowerSwift 0x00000001047149e4 $s12AIPowerSwift27AKLSMainEquipmentScanListVCC24carchargetBluetoothState6manage03bleJ0yAA0cd10CarChargetI6ManageC_So03lp_L6_stateatFTo + 80 24 AIPowerSwift 0x0000000104919ba4 $s12AIPowerSwift42AKLSMainEquipmentCarChargetBluetoothManageC15bleStateChanged6notifyy10Foundation12NotificationV_tF + 920 25 AIPowerSwift 0x000000010491a8e0 $s12AIPowerSwift42AKLSMainEquipmentCarChargetBluetoothManageC15bleStateChanged6notifyy10Foundation12NotificationV_tFTo + 152 26 CoreFoundation 0x0000000181f00c3c + 20 27 CoreFoundation 0x0000000181f001b8 + 428 28 CoreFoundation 0x0000000181efff14 + 216 29 CoreFoundation 0x0000000181f7d84c + 1408 30 CoreFoundation 0x0000000181e36f38 _CFXNotificationPost + 384 31 Foundation 0x00000001828a7bbc + 68 32 AIPowerSwift 0x0000000104e25d7c -[LPAVSBTManager postBLEStateChange:] + 1032 33 AIPowerSwift 0x0000000104e20048 -[LPAVSBTManager routeChange:] + 2504 34 CoreFoundation 0x0000000181f00c3c + 20 35 CoreFoundation 0x0000000181f001b8 + 428 36 CoreFoundation 0x0000000181efff14 + 216 37 CoreFoundation 0x0000000181f7d84c + 1408 38 CoreFoundation 0x0000000181e36f38 _CFXNotificationPost + 384 39 Foundation 0x00000001828a7bbc + 68 40 AVFAudio 2019-05-06 11:22:08.285040+0800 AIPowerSwift[622:189070] [reports] Main Thread Checker: UI API called on a background thread: -[UIView initWithCoder:] PID: 622, TID: 189070, Thread name: AVAudioSession Notify Thread, Queue name: com.apple.root.default-qos.overcommit, QoS: 21 Backtrace: 4 SwiftMessages 0x00000001093a5410 $s13SwiftMessages8BaseViewC5coderACSgSo7NSCoderC_tcfc + 1204 5 SwiftMessages 0x00000001093a5628 $s13SwiftMessages8BaseViewC5coderACSgSo7NSCoderC_tcfcTo + 56 6 SwiftMessages 0x00000001093b9318 $s13SwiftMessages11MessageViewC5coderACSgSo7NSCoderC_tcfc + 704 7 SwiftMessages 0x00000001093b93cc $s13SwiftMessages11MessageViewC5coderACSgSo7NSCoderC_tcfcTo + 56 8 UIKit 0x000000018c1edfec + 248 9 UIKit 0x000000018c34f738 + 688 10 UIKit 0x000000018c34f470 + 312 11 UIKit 0x000000018c1edc60 + 136 12 UIKit 0x000000018c34f738 + 688 13 UIKit 0x000000018c34f8b0 + 1064 14 UIKit 0x000000018c34f470 + 312 15 UIKit 0x000000018c1ecfe4 + 1164 16 UIKit 0x000000018c1f2c18 + 224 17 SwiftMessages 0x00000001093e3bac $s13SwiftMessagesAAC19internalViewFromNib33_AB28F0CA9BFF0B16E059C4C20EF9AFAALL5named6bundle10filesOwnerxSS_So8NSBundleCSgyXltKSo6UIViewCRbzlFZ + 948 18 SwiftMessages 0x00000001093e3fcc $s13SwiftMessagesAAC11viewFromNib5named10filesOwnerxSS_yXltKSo6UIViewCRbzlFZ + 96 19 SwiftMessages 0x00000001093ba264 $s13SwiftMessages11MessageViewC11viewFromNib6layout10filesOwnerxAC6LayoutO_yXltACRbzlFZ + 180 20 AIPowerSwift 0x0000000104681fbc $s12AIPowerSwift16AKLSActivityViewC09showBlackb7MessageD0_8bodyTextySS_SStFZ + 360 21 AIPowerSwift 0x0000000104682ffc $s12AIPowerSwift16AKLSActivityViewC011showWarningb7MessageD0_8bodyTextySS_SStFZ + 216 22 AIPowerSwift 0x00000001047146b4 $s12AIPowerSwift27AKLSMainEquipmentScanListVCC24carchargetBluetoothState6manage03bleJ0yAA0cd10CarChargetI6ManageC_So03lp_L6_stateatF + 2196 23 AIPowerSwift 0x00000001047149e4 $s12AIPowerSwift27AKLSMainEquipmentScanListVCC24carchargetBluetoothState6manage03bleJ0yAA0cd10CarChargetI6ManageC_So03lp_L6_stateatFTo + 80 24 AIPowerSwift 0x0000000104919ba4 $s12AIPowerSwift42AKLSMainEquipmentCarChargetBluetoothManageC15bleStateChanged6notifyy10Foundation12NotificationV_tF + 920 25 AIPowerSwift 0x000000010491a8e0 $s12AIPowerSwift42AKLSMainEquipmentCarChargetBluetoothManageC15bleStateChanged6notifyy10Foundation12NotificationV_tFTo + 152 26 CoreFoundation 0x0000000181f00c3c + 20 27 CoreFoundation 0x0000000181f001b8 + 428 28 CoreFoundation 0x0000000181efff14 + 216 29 CoreFoundation 0x0000000181f7d84c + 1408 30 CoreFoundation 0x0000000181e36f38 _CFXNotificationPost + 384 31 Foundation 0x00000001828a7bbc + 68 32 AIPowerSwift 0x0000000104e25d7c -[LPAVSBTManager postBLEStateChange:] + 1032 33 AIPowerSwift 0x0000000104e20048 -[LPAVSBTManager routeChange:] + 2504 34 CoreFoundation 0x0000000181f00c3c + 20 35 CoreFoundation 0x0000000181f001b8 + 428 36 CoreFoundation 0x0000000181efff14 + 216 37 CoreFoundation 0x0000000181f7d84c + 1408 38 CoreFoundation 0x0000000181e36f38 _CFXNotificationPost + 384 39 Foundation 0x00000001828a7bbc + 68 40 AVFAudio

wtmoose commented 5 years ago

Don't call SwiftMessages from a background queue.