NotificationBanner: Crashing all the time

Can you please explain why this library is crashing all the time to me? Here is the code to run the banner:

  func showBanner(text: String) {
    let banner = NotificationBanner(title: text, style: .info)
    banner.autoDismiss = false
    banner.applyStyling(titleFont: .custom(type: .regular, size: 14), titleColor: .white, titleTextAlign: .center)
    banner.backgroundColor = .init(red: 75, green: 75, blue: 75)
    banner.show()
  }

Here is the crash:

2020-12-17 12:46:06.465576+0100 APP[836:108657] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x28133a1c0 UIView:0x105b10580.width == - 16   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x28133a1c0 UIView:0x105b10580.width == - 16   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value: file NotificationBannerSwift/BaseNotificationBanner.swift, line 530
2020-12-17 12:46:08.752985+0100 APP[836:108657] Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value: file NotificationBannerSwift/BaseNotificationBanner.swift, line 530

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 24 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I’m on version 3.1.0 and still getting the crash whenever try to show banner.

A new version has been released. This issue should be fixed now. Update to the latest version and check if similar crashes occur in latest version.

The same occurs here on 3.0.6. This wasn’t an issue in 3.0.4. 3.0.2 (Cocoapods)

The relevant stack trace:

Crashed: com.apple.main-thread
0x105871868 BaseNotificationBanner.show(placeOnQueue:queuePosition:bannerPosition:) + 380 (BaseNotificationBanner.swift:380)
0x10587aa6c NotificationBannerQueue.addBanner(_:bannerPosition:queuePosition:) + 69 (NotificationBannerQueue.swift:69)
0x105870f6c BaseNotificationBanner.show(placeOnQueue:queuePosition:bannerPosition:) + 374 (BaseNotificationBanner.swift:374)
0x105875468 FloatingNotificationBanner.show(queuePosition:bannerPosition:queue:on:edgeInsets:cornerRadius:shadowColor:shadowOpacity:shadowBlurRadius:shadowCornerRadius:shadowOffset:shadowEdgeInsets:) + 332 (BaseNotificationBanner.swift:332)