Open pop-goes-the-Weasel opened 4 years ago
@kaandedeoglu you're help would be appreciated
I am having the same problem.
Do you have any crash logs, screenshots, or any leads you can post here please?
Sure.
i have my live app crashing to this, please provide a fix for it or point me in the right direction to the resolution of this crash. screenshot and .log file is attached for further debugging process.
Just remember, to reproduce this you'll need ipad with lower ios version i.e 9.3.6
version and a latest xcode i.e 11.5
@kaandedeoglu
@HamzaAtcoding I unfortunately don't own such device to reproduce the crash. One possible solution comes to mind:
It seems like the crash occurs while KDCircularProgress is being initialized through the IB. (KDCircularProgress is created through init(coder:) but KDCircularProgressViewLayer is created through init())
One thing you can try is to only keep a container UIView for KDCircularProgress in the IB. And in viewDidLoad
create the progress view programatically and add to the container, would that solve the issue?
as per your recommendation i have made the KDCircularProgress in viewdidload
for UIView container programmatically,
// progressView = KDCircularProgress(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
progressView = KDCircularProgress(frame: CGRect(x: 0, y: 0, width: 300, height: 300), colors: UIColor.cyan)
// progressView.startAngle = -90
// progressView.progressThickness = 0.2
// progressView.trackThickness = 0.6
// progressView.clockwise = true
// progressView.gradientRotateSpeed = 2
// progressView.roundedCorners = false
// progressView.glowMode = .forward
// progressView.glowAmount = 0.9
// progressView.set(colors: UIColor.cyan ,UIColor.white, UIColor.magenta, UIColor.white, UIColor.orange)
// progressView.center = CGPoint(x: view.center.x, y: view.center.y + 25)
view.addSubview(progressView)
these are my findings,
whatever init() i use
required public init(coder aDecoder: NSCoder)
going through storyboard
convenience public init(frame:CGRect, colors: UIColor...)
going through convenience init
override public init(frame: CGRect)
going through public
all of these leads to crash in the designated overridden init()
, i have trimmed it down as much as to close all properties and create a simple frame and add in view, but still a crash.
Maybe it has to do something in the way frame is created in KDCircularProgress that might be iOS 10+ versions dependent and not found in lower iOS version?
@kaandedeoglu
@HamzaAtcoding I'm really sorry, but I don't have anything. I'm not clear how a simple init is crashing..
any debugging that would help? @kaandedeoglu
could this be the issue with older iPads not having enough memory? i got this through debugging session with address sanitizer
==436==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clang_compiler_rt/clang-1103.0.32.62/compiler-rt/lib/sanitizer_common/sanitizer_mac_libcdep.cc:24 "((res != ((void *)-1))) != (0)" (0x0, 0x0)
<empty stack>
I don't think so, this library was initially developed during iOS 9 was the latest, and it used to work fine. I unfortunately don't have devices / Xcode versions to reproduce it on.
If I were you, I would start dissecting and see what causes the crash. For example just try to keep KDCircularProgress & KDCircularProgressLayer, removing more and more properties as you go along. I have a suspicion the @NSManaged trick might be causing issues..
After a solid dev day on trying to fix this, i can say for sure that this is 110% issue related to older iPads having less memory (i can confirm this by running this on xcode >11.5, compiling and not crashing on it), in the binaries updation of xcode 11.5 it most definitely updated something that causes older iPads memory to take a hit, after-all apple is known for deprecating their older products in devious ways. Even though this was developed in iOS 9.x times as mention by @kaandedeoglu, nobody can foresee the impending wreck that could have been caused by xcode updation, also as i mentioned earlier i have trimmed down the properties i.e. (angles, startAngle, clockwise, progressThickness etc) to just an extent to just make a frame out of it, but still crash took place
while using this framework on devices containing iOS latest
9.3.6 version
, there is a crash on the followingof
private class KDCircularProgressViewLayer: CALayer
Xcode: 11.5 MacOS: Catalina Device: iPad 3