luispadron / UICircularProgressRing

A circular progress bar for iOS written in Swift
MIT License
1.73k stars 290 forks source link

UICircularProgressRing crashes on init(frame:) while running on iOS9 #241

Closed kostins closed 4 years ago

kostins commented 4 years ago

Bug Report

Application compiled on Xcode 11.4 11.4.1 11.5 crashes on UICircularProgressRing while running on iOS 9.3 devices. No crashes on iOS 10 - 13. No crashes while compiling on Xcode 11.3.1 Most probably it's a bug of Xcode, but not guarantied.

Version

ANSWER HERE - 6.3.0

Overview of what you tried to do

ANSWER HERE - Launch an App where UICircularProgressRing should be shown on first screen.

What is the expected outcome?

ANSWER HERE - At least get that screen shown with progress ring on it.

What is the actual outcome?

ANSWER HERE - crash while launch screen (logo) shown

Post sample code or example here

If sample code can't be provided because it's too long, please provide a small example project, where I can test, if you cannot provide either. There is not much I can do.

ANSWER HERE - nothing special, here is fragment from viewDidLoad()
        // Volume Ring Setup
        self.volumeRing = UICircularProgressRing(frame:CGRect(origin: .zero, size: CGSize(width: 46.0, height: 46.0)))
        if let v = self.volumeRing{
            self.minContentView?.addSubview(v)
            v.value = 50
            v.minValue = 0
            v.shouldShowValueText = false
            v.maxValue = 100
            v.startAngle = 90
            v.endAngle = 90
            v.outerRingColor = UIColor(white: 1.0, alpha: 0.18)
            v.outerRingWidth = 2
            v.innerRingColor = .white
            v.innerRingWidth = 2
            v.innerRingSpacing = -4
        }

If UICircularProgressRing is embedded into storyboard, the result is the same.

luispadron commented 4 years ago

Could you provide the error you are getting?

kostins commented 4 years ago

This is from debugger

Thread 1: EXC_BAD_ACCESS (code=1, address=0xe0000010)

1 0x00fa7d84 in UICircularRingLayer.init() at .../Pods/UICircularProgressRing/src/UICircularProgressRing/UICircularRingLayer.swift:82

2 0x00fa7e30 in @objc UICircularRingLayer.init() ()

3 0x2747102a in -[UIView _createLayerWithFrame:] ()

4 0x27470b4e in UIViewCommonInitWithFrame ()

5 0x2747078a in -[UIView initWithFrame:] ()

6 0x00fa306c in UICircularRing.init(frame:) at .../Pods/UICircularProgressRing/src/UICircularProgressRing/UICircularRing.swift:381

7 0x00fa3124 in @objc UICircularRing.init(frame:) ()

8 0x00f9e772 in UICircularProgressRing.init(frame:) ()

9 0x00f9e7c0 in @objc UICircularProgressRing.init(frame:) ()

10 0x00f9e3ea in UICircularProgressRing.__allocating_init(frame:) ()


This is extraction from Crashlytics on release version (UICircularProgressRing is embedded into storyboard) Crashed: com.apple.main-thread EXC_BREAKPOINT 0x000000000000defe

Crashed: com.apple.main-thread 0 UICircularProgressRing 0x762b9a UICircularRingLayer.drawOuterRing() + 163 (UICircularRingLayer.swift:163) 1 UICircularProgressRing 0x762765 UICircularRingLayer.drawOuterRing() + 163 (UICircularRingLayer.swift:163) 2 UICircularProgressRing 0x76202d UICircularRingLayer.draw(in:) + 111 (UICircularRingLayer.swift:111) 3 UICircularProgressRing 0x76212b @objc UICircularRingLayer.draw(in:) + 7545131 (:7545131) 4 QuartzCore 0x2754eff5 CABackingStoreUpdate_ + 1952 5 QuartzCore 0x27642771 _ZN2CA5Layer8display_Ev_blockinvoke + 56 6 QuartzCore 0x2754e4c1 CA::Layer::display() + 1328 7 QuartzCore 0x27532551 CA::Layer::display_if_needed(CA::Transaction) + 204 8 QuartzCore 0x27532211 CA::Layer::layout_and_display_if_needed(CA::Transaction) + 24 9 QuartzCore 0x275316d1 CA::Context::commit_transaction(CA::Transaction*) + 368 10 QuartzCore 0x275313a5 CA::Transaction::commit() + 520 11 QuartzCore 0x2752ab2b CA::Transaction::observer_callback(CFRunLoopObserver, unsigned long, void) + 138 12 CoreFoundation 0x24ee96c9 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 20 13 CoreFoundation 0x24ee79cd __CFRunLoopDoObservers + 280 14 CoreFoundation 0x24e37249 CFRunLoopRunSpecific + 552 15 CoreFoundation 0x24e37015 CFRunLoopRunInMode + 108 16 UIKit 0x29510c3d -[UIApplication _run] + 524 17 UIKit 0x2950b189 UIApplicationMain + 144

xiaoojun commented 4 years ago

The same problem, look forward to the author's fix

luispadron commented 4 years ago

So I did test this with my deployment target set to iOS 9.0, it's working fine.

I'm not able to test on an iOS 9.0 simulator as I'm on the latest macOS which dropped support for 32 bit simulators. I'm afraid I cant diagnose this further at this time. As you mentioned this is more than likely an issue with Xcode or the simulator as there haven't been many changes to this library in months.

hjqiaho commented 3 years ago

same problem ,iPhone 6,iOS9.1

kostins commented 3 years ago

same problem ,iPhone 6,iOS9.1

As problem still persists, this library has been removed from my project

Bhide commented 3 years ago

Facing the same issue with iOS 9.3.5 on iPad Mini (32 bit device).