Closed minaMagedNaeem closed 3 years ago
Note: The viewController with skeletonable views has a table view and its cells are skeletonable
Hi @minaMagedNaeem, version 1.8.6 is ready to use. This version has a change related to trait collection changes, but I don't know if it will solve this issue. Could you check it?
Thanks
No, The issue is still happening
Sorry, I can’t reproduce this issue. Could you provide an example with the code with which you are getting this crash, please?
Skeleton view version: 1.8.6 iOS version: 12.4
Hai, I experienced the same thing on iOS 12 @Juanpe . After I tracked it, this happened in version 1.8.3. Thanks
Hello, Have you find a solution ?
I am also facing same issue with DatePicker. Application is crashing with same logs.
2020-02-27 18:53:38.765319+0800 MIHP[13650:325088] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 1]'
*** First throw call stack:
(
0 CoreFoundation 0x0000000112cc81ab __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001113a6f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000112d07f9c _CFThrowFormattedException + 194
3 CoreFoundation 0x0000000112bf809f -[__NSArrayM objectAtIndex:] + 175
4 UIKit 0x000000010efef389 -[UIPickerView selectedRowInComponent:] + 76
5 UIKit 0x000000010fb3e35c -[_UIDatePickerMode_DateAndTime _shouldEnableValueForRow:inComponent:calendarUnit:] + 266
6 UIKit 0x000000010fb39ed9 -[_UIDatePickerMode _shouldEnableValueForRow:column:] + 68
7 UIKit 0x000000010fb39a6f -[_UIDatePickerMode viewForRow:inComponent:reusingView:] + 956
8 UIKit 0x000000010fb3e5c2 -[_UIDatePickerMode_DateAndTime viewForRow:inComponent:reusingView:] + 206
9 UIKit 0x000000010fb2c3d9 -[_UIDatePickerView pickerView:viewForRow:forComponent:reusingView:] + 60
10 UIKit 0x000000010efefac6 -[UIPickerView tableView:cellForRowAtIndexPath:] + 621
11 UIKit 0x000000010fb16428 -[UIPickerColumnView tableView:cellForRowAtIndexPath:] + 168
12 UIKit 0x000000010f169e45 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 778
13 UIKit 0x000000010f16a3eb -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
14 UIKit 0x000000010f1305f0 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2892
15 UIKit 0x000000010f146199 -[UITableView _visibleCellsUsingPresentationValues:] + 514
16 SkeletonView 0x000000010ea27dad $sSo11UITableViewC08SkeletonB0E010subviewsToC0SaySo6UIViewCGvg + 61
17 SkeletonView 0x000000010ea27d25 $sSo11UITableViewC08SkeletonB0E010subviewsToC0SaySo6UIViewCGvgTo + 53
18 SkeletonView 0x000000010ea279e7 $sSo6UIViewC12SkeletonViewE21subviewsSkeletonablesSayABGvg + 71
19 SkeletonView 0x000000010ea27955 $sSo6UIViewC12SkeletonViewE21subviewsSkeletonablesSayABGvgTo + 53
20 SkeletonView 0x000000010ea3a909 $sSo6UIViewC12SkeletonViewE02isB6ActiveSbvg + 217
21 SkeletonView 0x000000010ea245fb $sSo6UIViewC12SkeletonViewE32skeletonTraitCollectionDidChangeyySo07UITraitF0CSgF + 171
22 SkeletonView 0x000000010ea246e4 $sSo6UIViewC12SkeletonViewE32skeletonTraitCollectionDidChangeyySo07UITraitF0CSgFTo + 68
23 UIKit 0x000000010f0fcd8c -[UIScrollView traitCollectionDidChange:] + 73
24 UIKit 0x000000010f13bfd8 -[UITableView traitCollectionDidChange:] + 74
25 UIKit 0x000000010f0afe40 -[UIView _wrappedProcessTraitCollectionDidChange:forceNotification:] + 163
26 UIKit 0x000000010f0aff3c -[UIView _wrappedProcessTraitCollectionDidChange:forceNotification:] + 415
27 UIKit 0x000000010f0aff3c -[UIView _wrappedProcessTraitCollectionDidChange:forceNotification:] + 415
28 UIKit 0x000000010fb7e2bb -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 104
29 UIKit 0x000000010f0b01f7 -[UIView _processDidChangeRecursivelyFromOldTraits:toCurrentTraits:forceNotification:] + 151
30 UIKit 0x000000010f0c43b4 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 767
31 Foundation 0x000000010d0e8de1 -[NSISEngine withBehaviors:performModifications:] + 131
32 UIKit 0x000000010f0c404e -[UIView(Hierarchy) _postMovedFromSuperview:] + 855
33 UIKit 0x000000010f0d494d -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1973
34 UIKit 0x000000010efed00a __30-[UIPickerView layoutSubviews]_block_invoke + 5377
35 UIKit 0x000000010f0cc8f0 +[UIView(Animation) performWithoutAnimation:] + 90
36 UIKit 0x000000010efebacb -[UIPickerView layoutSubviews] + 159
37 UIKit 0x000000010fb2c718 -[_UIDatePickerView layoutSubviews] + 103
38 UIKit 0x000000010efef36a -[UIPickerView selectedRowInComponent:] + 45
39 UIKit 0x000000010efe9fdc -[UIPickerView _updateSelectedRows] + 143
40 UIKit 0x000000010efea076 -[UIPickerView didMoveToWindow] + 101
41 UIKit 0x000000010f0d1dd7 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1748
42 UIKit 0x000000010f0d1a14 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 785
43 UIKit 0x000000010f188926 -[UIControl _didMoveFromWindow:toWindow:] + 67
44 UIKit 0x000000010f0c414c __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 151
45 Foundation 0x000000010d0e8de1 -[NSISEngine withBehaviors:performModifications:] + 131
46 UIKit 0x000000010f0c404e -[UIView(Hierarchy) _postMovedFromSuperview:] + 855
47 UIKit 0x000000010f0d494d -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1973
..
...
51 UIKit 0x000000010f0cde35 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 859
52 UIKit 0x000000010f0a099d -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 354
53 UIKit 0x000000010f0a0fde -[UIViewAnimationState animationDidStop:finished:] + 293
54 QuartzCore 0x000000010e5a2a2b _ZN2CA5Layer23run_animation_callbacksEPv + 323
55 libdispatch.dylib 0x00000001145f743c _dispatch_client_callout + 8
56 libdispatch.dylib 0x00000001146026f0 _dispatch_main_queue_callback_4CF + 628
57 CoreFoundation 0x0000000112c8aee9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
58 CoreFoundation 0x0000000112c4f592 __CFRunLoopRun + 2402
59 CoreFoundation 0x0000000112c4e9b9 CFRunLoopRunSpecific + 409
60 GraphicsServices 0x000000011767c9c6 GSEventRunModal + 62
61 UIKit 0x000000010f00a5e8 UIApplicationMain + 159
63 libdyld.dylib 0x0000000114673d81 start + 1
64 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
The best solution for now used version 1.8.2 @byMohamedali
Thank you @bagusandinata, The bug seems to append on iOS 12.3.1, it's working fine on iOS 12.2
Also experienced the same in our app, unfortunately released into the wild :( Stacktrace below if it helps
Fatal Exception: NSRangeException
0 CoreFoundation 0x207437518 exceptionPreprocess
1 libobjc.A.dylib 0x2066129f8 objc_exception_throw
2 CoreFoundation 0x2073b0f8c _CFArgv
3 CoreFoundation 0x207322f14 _CFDataInit
4 UIKitCore 0x23355b868 -[UIPickerView tableViewForColumn:]
5 UIKitCore 0x2335429a4 -[_UIDatePickerMode _isComponentScrolling:]
6 UIKitCore 0x233542b58 -[_UIDatePickerMode _shouldEnableValueForRow:column:]
7 UIKitCore 0x233542630 -[_UIDatePickerMode viewForRow:inComponent:reusingView:]
8 UIKitCore 0x23354dd44 -[_UIDatePickerView pickerView:viewForRow:forComponent:reusingView:]
9 UIKitCore 0x23355bde0 -[UIPickerView tableView:cellForRowAtIndexPath:]
10 UIKitCore 0x2335505a0 -[UIPickerColumnView tableView:cellForRowAtIndexPath:]
11 UIKitCore 0x2337daa38 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:]
12 UIKitCore 0x2337daf38 -[UITableView _createPreparedCellForGlobalRow:willDisplay:]
13 UIKitCore 0x2337a7740 -[UITableView _updateVisibleCellsNow:isRecursive:]
14 UIKitCore 0x2337b9f14 -[UITableView visibleCellsUsingPresentationValues:]
15 SkeletonView 0x104340a30 UITableView.subviewsToSkeleton.getter + 17 (SubviewsSkeletonables.swift:17)
16 SkeletonView 0x1043409b4 @objc UIView.subviewsSkeletonables.getter
17 SkeletonView 0x10434076c UIView.subviewsSkeletonables.getter + 7 (SubviewsSkeletonables.swift:7)
18 SkeletonView 0x1043409b4 @objc UIView.subviewsSkeletonables.getter
19 SkeletonView 0x104347f08 UIView.isSkeletonActive.getter + 13 (UIView+IBInspectable.swift:13)
20 SkeletonView 0x1043402b8 specialized UIView.skeletonTraitCollectionDidChange(:) + 103 (SkeletonView.swift:103)
21 SkeletonView 0x10433c704 @objc UIView.skeletonTraitCollectionDidChange(_:) (
I'm sorry its out of the issue context, but when I try installing 1.8.2 using this line ' ' ' pod 'SkeletonView', '~> 1.8.2' ' ' ' and pod install it installs 1.8.6 instead of 1.8.2 how can I get 1.8.2?
I figured it out, the line has to be pod 'SkeletonView', '1.8.2'
I am also facing same issue with DatePicker. Application is crashing.
The best solution for now used version 1.8.2 @byMohamedali
pod 'SkeletonView', '1.8.2' After i am instilling above pod also app is crashing. is there any alternate solution
@Juanpe the bug exists on ios simulator 12.2 or for the device 12.3.1 (which is same according to this )
some of the stack trace are following,
Terminating app due to uncaught exception 'NSRangeException', reason: ' -[NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 0]' *** First throw call stack: ( 0 CoreFoundation 0x00000001132d86fb exceptionPreprocess + 331 1 libobjc.A.dylib 0x0000000112622ac5 objc_exception_throw + 48 2 CoreFoundation 0x0000000113226ddc _CFThrowFormattedException + 194 3 CoreFoundation 0x0000000113203312 -[__NSArrayM objectAtIndex:] + 178 4 UIKitCore 0x000000011cc90b00 -[UIPickerView tableViewForColumn:] + 61 5 UIKitCore 0x000000011cc76387 -[_UIDatePickerMode _isComponentScrolling:] + 57 6 UIKitCore 0x000000011cc76509 -[_UIDatePickerMode _shouldEnableValueForRow:column:] + 180 7 UIKitCore 0x000000011cc7604d -[_UIDatePickerMode viewForRow:inComponent:reusingView:] + 942 8 UIKitCore 0x000000011cc81c66 -[_UIDatePickerView pickerView:viewForRow:forComponent:reusingView:] + 60 9 UIKitCore 0x000000011cc9107c -[UIPickerView tableView:cellForRowAtIndexPath:] + 620
@Juanpe I mage a pull request that hopefully can fix this crash https://github.com/Juanpe/SkeletonView/pull/275
That PR fixed the issue for me.
I have downgraded to 1.8.2 but the crash still exist any updates ?
Also experiencing this crash, and tried versions 1.8.2-1.8.6 to resolve. Steps to reproduce were similar: pushing date picker after skeleton view was already in view hierarchy.
After some investigation the crash occurs in SubviewsSkeletonables.swift
line 17 when accessing visibleCells
. Removing call to visibleCells resolved the crash, but unsure of best solution going forward.
@trekirkman The fix was merged to master, but not released. It is not in 1.8.6. I configured cocoapods to use the git URL as source rather than the version number tag. Not sure what's holding up a minor/patch bump.
Hi all, version 1.8.7 has been released :) sorry for the delay
can confirm 1.8.7 fixes crash
I am having this issue as well on 1.8.6. Will try updating to 1.8.7
the crash not existing on 1.8.7
nop 1.8.2 to 1.8.7 still happening 1.8.1 is not happening I'm using iOS 11 (iOS 13 crash is not there for all versions tried 1.8.2- 1.8.3 - 1.8.6 - 1.8.7)
2020-07-01 18:47:56.323559+0100 Baims Stagging[34181:1043055] Terminating app due to uncaught exception 'NSRangeException', reason: ' -[NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]' *** First throw call stack: ( 0 CoreFoundation 0x00000001129b61cb exceptionPreprocess + 171 1 libobjc.A.dylib 0x0000000111ecaf41 objc_exception_throw + 48 2 CoreFoundation 0x00000001129f5e8c _CFThrowFormattedException + 194 3 CoreFoundation 0x00000001128e62cf -[NSArrayM objectAtIndex:] + 175 4 UIKit 0x000000010d645fb9 -[UIPickerView selectedRowInComponent:] + 76 5 UIKit 0x000000010e18feee -[_UIDatePickerMode _updateSelectedDateComponentsWithNewValueInComponent:usingSelectionBarValue:] + 732 6 UIKit 0x000000010e190217 -[_UIDatePickerMode selectedDateComponents] + 52 7 UIKit 0x000000010e1957e6 -[_UIDatePickerMode_DateAndTime _shouldEnableValueForRow:inComponent:calendarUnit:] + 100 8 UIKit 0x000000010e191409 -[_UIDatePickerMode _shouldEnableValueForRow:column:] + 68 9 UIKit 0x000000010e190f9f -[_UIDatePickerMode viewForRow:inComponent:reusingView:] + 956 10 UIKit 0x000000010e195af2 -[_UIDatePickerMode_DateAndTime viewForRow:inComponent:reusingView:] + 206 11 UIKit 0x000000010e183909 -[_UIDatePickerView pickerView:viewForRow:forComponent:reusingView:] + 60 12 UIKit 0x000000010d6466f6 -[UIPickerView tableView:cellForRowAtIndexPath:] + 621 13 UIKit 0x000000010e16d958 -[UIPickerColumnView tableView:cellForRowAtIndexPath:] + 168 14 UIKit 0x000000010d7c0b99 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 778 15 UIKit 0x000000010d7c113f -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74 16 UIKit 0x000000010d787344 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2892 17 UIKit 0x000000010d79ceed -[UITableView _visibleCellsUsingPresentationValues:] + 514 18 SkeletonView 0x000000010cda1423 $sSo11UITableViewC08SkeletonB0E010subviewsToC0SaySo6UIViewCGvg + 35 19 SkeletonView 0x000000010cda13b5 $sSo11UITableViewC08SkeletonB0E010subviewsToC0SaySo6UIViewCGvgTo + 53 20 SkeletonView 0x000000010cda10d6 $sSo6UIViewC12SkeletonViewE21subviewsSkeletonablesSayABGvg + 54 21 SkeletonView 0x000000010cda1055 $sSo6UIViewC12SkeletonViewE21subviewsSkeletonablesSayABGvgTo + 53 22 SkeletonView 0x000000010cdb2b9c $sSo6UIViewC12SkeletonViewE02isB6ActiveSbvg + 172 23 SkeletonView 0x000000010cd9e113 $sSo6UIViewC12SkeletonViewE32skeletonTraitCollectionDidChangeyySo07UITraitF0CSgF + 131 24 SkeletonView 0x000000010cd9e1e4 $sSo6UIViewC12SkeletonViewE32skeletonTraitCollectionDidChangeyySo07UITraitF0CSgFTo + 68 25 UIKit 0x000000010d753b88 -[UIScrollView traitCollectionDidChange:] + 73 26 UIKit 0x000000010d792d2c -[UITableView traitCollectionDidChange:] + 74 27 UIKit 0x000000010d706c3c -[UIView _wrappedProcessTraitCollectionDidChange:forceNotification:] + 163 28 UIKit 0x000000010d706d38 -[UIView _wrappedProcessTraitCollectionDidChange:forceNotification:] + 415 29 UIKit 0x000000010d706d38 -[UIView _wrappedProcessTraitCollectionDidChange:forceNotification:] + 415 30 UIKit 0x000000010e1d57eb -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 104 31 UIKit 0x000000010d706ff3 -[UIView _processDidChangeRecursivelyFromOldTraits:toCurrentTraits:forceNotification:] + 151 32 UIKit 0x000000010d71b1b0 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 767 33 Foundation 0x000000010a950de1 -[NSISEngine withBehaviors:performModifications:] + 131 34 UIKit 0x000000010d71ae4a -[UIView(Hierarchy) _postMovedFromSuperview:] + 855 35 UIKit 0x000000010d72b749 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1973 36 UIKit 0x000000010d643c3a 30-[UIPickerView layoutSubviews]_block_invoke + 5377 37 UIKit 0x000000010d7236ec +[UIView(Animation) performWithoutAnimation:] + 90 38 UIKit 0x000000010d6426fb -[UIPickerView layoutSubviews] + 159 39 UIKit 0x000000010e183c48 -[_UIDatePickerView layoutSubviews] + 103 40 UIKit 0x000000010d645f9a -[UIPickerView selectedRowInComponent:] + 45 41 UIKit 0x000000010d640c0c -[UIPickerView _updateSelectedRows] + 143 42 UIKit 0x000000010d640ca6 -[UIPickerView didMoveToWindow] + 101 43 UIKit 0x000000010d728bd3 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1748 44 UIKit 0x000000010d728810 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 785 45 UIKit 0x000000010d7df67a -[UIControl _didMoveFromWindow:toWindow:] + 67 46 UIKit 0x000000010d71af48 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 151 47 Foundation 0x000000010a950de1 -[NSISEngine withBehaviors:performModifications:] + 131 48 UIKit 0x000000010d71ae4a -[UIView(Hierarchy) _postMovedFromSuperview:] + 855 49 UIKit 0x000000010d72b749 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1973 50 UIKit 0x000000010e2b86a2 -[UIInputWindowController changeToInputViewSet:] + 597 51 UIKit 0x000000010e2b97f4 43-[UIInputWindowController setInputViewSet:]_block_invoke + 57 52 UIKit 0x000000010d7236ec +[UIView(Animation) performWithoutAnimation:] + 90 53 UIKit 0x000000010e2b952f -[UIInputWindowController setInputViewSet:] + 702 54 UIKit 0x000000010e2b09d1 -[UIInputWindowController performOperations:withAnimationStyle:] + 50 55 UIKit 0x000000010de51f9e -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] + 1081 56 UIKit 0x000000010d894acd -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] + 81 57 UIKit 0x000000010e379cc7 -[UITextField becomeFirstResponder] + 690 58 UIKit 0x000000010dc6b960 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 208 59 UIKit 0x000000010dc3c159 -[UITextGestureClusterSelection oneFingerTap:] + 3845 60 UIKit 0x000000010dc5aefb -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 57 61 UIKit 0x000000010dc63d83 _UIGestureRecognizerSendTargetActions + 109 62 UIKit 0x000000010dc6162e _UIGestureRecognizerSendActions + 307 63 UIKit 0x000000010dc6089a -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 1002 64 UIKit 0x000000010dc45bfd _UIGestureEnvironmentUpdate + 1306 65 UIKit 0x000000010dc45697 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 484 66 UIKit 0x000000010dc44743 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 288 67 UIKit 0x000000010d6da228 -[UIWindow sendEvent:] + 4102 68 UIKit 0x000000010d67dd96 -[UIApplication sendEvent:] + 352 69 UIKit 0x000000010dfbffce dispatchPreprocessedEventFromEventQueue + 2809 70 UIKit 0x000000010dfc2c23 handleEventQueueInternal + 5957 71 CoreFoundation 0x00000001129592b1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 72 CoreFoundation 0x00000001129f8d31 CFRunLoopDoSource0 + 81 73 CoreFoundation 0x000000011293dc19 CFRunLoopDoSources0 + 185 74 CoreFoundation 0x000000011293d1ff CFRunLoopRun + 1279 75 CoreFoundation 0x000000011293ca89 CFRunLoopRunSpecific + 409 76 GraphicsServices 0x000000011577c9c6 GSEventRunModal + 62 77 UIKit 0x000000010d66123c UIApplicationMain + 159 78 Baims Stagging 0x00000001074a74db main + 75 79 libdyld.dylib 0x0000000113ca5d81 start + 1 80 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException
Same crash for iOS 12.4 (iOS 13+ is fine). Tried 1.9.0 version
Hi guys, I noticed that this issue is solved in the latest version (1.23.0).
You can check it using the provided sample project. SkeletonCrash_Fixed.zip
https://user-images.githubusercontent.com/1409041/130047742-6701efb2-5824-499d-a1bb-9c854e5f0aaa.mp4
I'm going to close this issue. Feel free to reopen it :)
What did you do?
tried to push a view controller with a DatePickerView with mode set to .time when there was a view controller with skeletonable views in the navigation controller stack
What did you expect to happen?
The view controller will be pushed and I will be able to see the DatePickerView
What happened instead?
The app crashed on appDelegate start
Call Stack
Steps to reproduce the behavior
SkeletonView Environment
SkeletonView version: 1.8.5 Xcode version: 11.3.1 Swift version: Swift 5