Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash xcode 10.2 #554

Closed
usman-whizpool opened this issue Mar 26, 2019 · 14 comments
Closed

crash xcode 10.2 #554

usman-whizpool opened this issue Mar 26, 2019 · 14 comments
Assignees
Milestone

Comments

@usman-whizpool
Copy link

Update xcode to latest one. now app crash on using svgcolor view. it was working on previous one before update.

crash log:
When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView(UIConstraintBasedLayout) _viewHierarchyUnpreparedForConstraint:] to debug.
2019-03-26 16:07:18.180525+0500 TheQuranApp[18096:632046] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'This coder requires that replaced objects be returned from initWithCoder:'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110a7b6fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010f9a1ac5 objc_exception_throw + 48
2 CoreFoundation 0x0000000110a7b555 +[NSException raise:format:] + 197
3 UIFoundation 0x0000000115c5b89c UINibDecoderDecodeObjectForValue + 827
4 UIFoundation 0x0000000115c5baf9 UINibDecoderDecodeObjectForValue + 1432
5 UIFoundation 0x0000000115c5b554 -[UINibDecoder decodeObjectForKey:] + 251
6 UIKitCore 0x000000011a5a2705 -[UIView initWithCoder:] + 802
7 UIFoundation 0x0000000115c5b852 UINibDecoderDecodeObjectForValue + 753
8 UIFoundation 0x0000000115c5baf9 UINibDecoderDecodeObjectForValue + 1432
9 UIFoundation 0x0000000115c5b554 -[UINibDecoder decodeObjectForKey:] + 251
10 UIKitCore 0x000000011a5a2705 -[UIView initWithCoder:] + 802
11 UIFoundation 0x0000000115c5b852 UINibDecoderDecodeObjectForValue + 753
12 UIFoundation 0x0000000115c5b554 -[UINibDecoder decodeObjectForKey:] + 251
13 UIKitCore 0x0000000119d87b41 -[UIRuntimeConnection initWithCoder:] + 178
14 UIFoundation 0x0000000115c5b852 UINibDecoderDecodeObjectForValue + 753
15 UIFoundation 0x0000000115c5baf9 UINibDecoderDecodeObjectForValue + 1432
16 UIFoundation 0x0000000115c5b554 -[UINibDecoder decodeObjectForKey:] + 251
17 UIKitCore 0x0000000119d853f1 -[UINib instantiateWithOwner:options:] + 1216
18 UIKitCore 0x0000000119b023af -[UIViewController _loadViewFromNibNamed:bundle:] + 382
19 UIKitCore 0x0000000119b02d39 -[UIViewController loadView] + 177
20 UIKitCore 0x0000000119b03048 -[UIViewController loadViewIfRequired] + 172
21 UIKitCore 0x0000000119a67004 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 68
22 UIKitCore 0x0000000119a672f7 -[UINavigationController _startTransition:fromViewController:toViewController:] + 146
23 UIKitCore 0x0000000119a683b5 -[UINavigationController _startDeferredTransitionIfNeeded:] + 896
24 UIKitCore 0x0000000119a696a7 -[UINavigationController __viewWillLayoutSubviews] + 150
25 UIKitCore 0x0000000119a4a38d -[UILayoutContainerView layoutSubviews] + 217
26 UIKitCore 0x000000011a5d39c1 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1417
27 QuartzCore 0x000000010f04beae -[CALayer layoutSublayers] + 173
28 QuartzCore 0x000000010f050b88 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 396
29 QuartzCore 0x000000010f05cee4 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 72
30 QuartzCore 0x000000010efcc3aa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 328
31 QuartzCore 0x000000010f003584 _ZN2CA11Transaction6commitEv + 608
32 UIKitCore 0x000000011a11eccb __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 128
33 CoreFoundation 0x00000001109e2aec CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12
34 CoreFoundation 0x00000001109e22b0 __CFRunLoopDoBlocks + 336
35 CoreFoundation 0x00000001109dcb34 __CFRunLoopRun + 1252
36 CoreFoundation 0x00000001109dc302 CFRunLoopRunSpecific + 626
37 GraphicsServices 0x0000000115ecb2fe GSEventRunModal + 65
38 UIKitCore 0x000000011a105ba2 UIApplicationMain + 140
39 TheQuranApp 0x000000010de6128b main + 75
40 libdyld.dylib 0x000000011402a541 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

@amarunko
Copy link
Contributor

Hi, @Usman4Github, yea, I found the same issue. Trying to fix now

@usman-whizpool
Copy link
Author

great. waiting for further updates

@ivanicspeter92
Copy link

ivanicspeter92 commented Mar 26, 2019

I am not sure if it is related in any way, but I face a similar issue in our application where Macaw is integrated to since the upgrade. The usage of the library is pretty simple, there is an instance of this class set up from the storyboard in the app.

import Macaw

@IBDesignable
class SVGImageView: MacawView {
    @IBInspectable public dynamic var url: String = "" {
        didSet {
            guard
                let url = URL(string: url),
                let text = try? String(contentsOf: url, encoding: .utf8),
                let node = try? SVGParser.parse(text: text)
                else {
                    return
            }

            self.node = node
        }
    }
}

Whenever the viewcontroller creates an instance of this, the application crashes without an error dump and this error since the upgrade to Xcode 10.2:

Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

@amarunko
Copy link
Contributor

This issue fixed in the master branch, and will be available in next release

@usman-whizpool
Copy link
Author

great. when it will be available

@amarunko
Copy link
Contributor

Release?

@usman-whizpool
Copy link
Author

yes. i mean how can we get fixed code. do we need to update pod or what else

@amarunko
Copy link
Contributor

amarunko commented Mar 27, 2019

You can change in pod file (instead of pod 'Macaw'):

pod 'Macaw', :git => 'https://github.com/exyte/Macaw.git', :branch => 'master'

and run pod update

@usman-whizpool
Copy link
Author

ok great. thanks

@ystrot ystrot self-assigned this Mar 27, 2019
@ystrot ystrot added this to the 0.9.5 milestone Mar 27, 2019
@usman-whizpool
Copy link
Author

update as above.

facing this issue now:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -containsValueForKey: cannot be sent to an abstract object of class NSCoder: Create a concrete instance!'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110af36fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010fa19ac5 objc_exception_throw + 48
2 CoreFoundation 0x0000000110af3555 +[NSException raise:format:] + 197
3 Foundation 0x000000010f457dc5 -[NSCoder containsValueForKey:] + 39
4 UIKitCore 0x000000011ab06478 -[UIView initWithCoder:] + 149
5 Macaw 0x000000010eb66384 $s5Macaw5MViewC5coderACSgSo7NSCoderC_tcfc + 148
6 Macaw 0x000000010eb6642f $s5Macaw5MViewC5coderACSgSo7NSCoderC_tcfcTo + 47
7 Macaw 0x000000010eb4d9f6 $s5Macaw0A4ViewC4node5coderACSgAA4NodeC_So7NSCoderCtcfc + 1638
8 Macaw 0x000000010ec0d687 $s5Macaw7SVGViewC4node5coderACSgAA4NodeC_So7NSCoderCtcfc + 263
9 TheQuranApp 0x000000010de202aa $s11TheQuranApp12SVGColorViewC4node5coderACSg5Macaw4NodeC_So7NSCoderCtcfc + 954
10 TheQuranApp 0x000000010de203a4 $s11TheQuranApp12SVGColorViewC4node5coderACSg5Macaw4NodeC_So7NSCoderCtcfcTo + 68
11 TheQuranApp 0x000000010de1c3dd $s11TheQuranApp12SVGColorViewCACycfc + 237
12 TheQuranApp 0x000000010de1c553 $s11TheQuranApp12SVGColorViewCACycfcTo + 19
13 TheQuranApp 0x000000010de1c2eb $s11TheQuranApp12SVGColorViewCACycfC + 27
14 TheQuranApp 0x000000010df2eb24 $s11TheQuranApp20CenterViewControllerC5coderACSgSo7NSCoderC_tcfc + 1732
15 TheQuranApp 0x000000010df2ec7f $s11TheQuranApp20CenterViewControllerC5coderACSgSo7NSCoderC_tcfcTo + 47
16 UIKitCore 0x000000011a2e74f9 -[UIClassSwapper initWithCoder:] + 246
17 UIFoundation 0x0000000116306852 UINibDecoderDecodeObjectForValue + 753
18 UIFoundation 0x0000000116306554 -[UINibDecoder decodeObjectForKey:] + 251
19 UIKitCore 0x000000011a2ebb41 -[UIRuntimeConnection initWithCoder:] + 178
20 UIFoundation 0x0000000116306852 UINibDecoderDecodeObjectForValue + 753
21 UIFoundation 0x0000000116306af9 UINibDecoderDecodeObjectForValue + 1432
22 UIFoundation 0x0000000116306554 -[UINibDecoder decodeObjectForKey:] + 251
23 UIKitCore 0x000000011a2e93f1 -[UINib instantiateWithOwner:options:] + 1216
24 UIKitCore 0x000000011a801c60 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
25 TheQuranApp 0x000000010de04281 $s11TheQuranApp25CenterPagerViewControllerC04viewG7AtIndex5indexAA0dfG0CSi_tF + 241
26 TheQuranApp 0x000000010de0405a $s11TheQuranApp25CenterPagerViewControllerC07addPagefG0yyF + 4042
27 TheQuranApp 0x000000010ddf9907 $s11TheQuranApp25CenterPagerViewControllerC11viewDidLoadyyF + 3703
28 TheQuranApp 0x000000010ddfba14 $s11TheQuranApp25CenterPagerViewControllerC11viewDidLoadyyFTo + 36
29 UIKitCore 0x000000011a06743b -[UIViewController loadViewIfRequired] + 1183
30 UIKitCore 0x0000000119fcb004 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 68
31 UIKitCore 0x0000000119fcb2f7 -[UINavigationController _startTransition:fromViewController:toViewController:] + 146
32 UIKitCore 0x0000000119fcc3b5 -[UINavigationController _startDeferredTransitionIfNeeded:] + 896
33 UIKitCore 0x0000000119fcd6a7 -[UINavigationController __viewWillLayoutSubviews] + 150
34 UIKitCore 0x0000000119fae38d -[UILayoutContainerView layoutSubviews] + 217
35 UIKitCore 0x000000011ab379c1 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1417
36 QuartzCore 0x000000010f0c3eae -[CALayer layoutSublayers] + 173
37 QuartzCore 0x000000010f0c8b88 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 396
38 QuartzCore 0x000000010f0d4ee4 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 72
39 QuartzCore 0x000000010f0443aa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 328
40 QuartzCore 0x000000010f07b584 _ZN2CA11Transaction6commitEv + 608
41 UIKitCore 0x000000011a682ccb __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 128
42 CoreFoundation 0x0000000110a5aaec CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12
43 CoreFoundation 0x0000000110a5a2b0 __CFRunLoopDoBlocks + 336
44 CoreFoundation 0x0000000110a54b34 __CFRunLoopRun + 1252
45 CoreFoundation 0x0000000110a54302 CFRunLoopRunSpecific + 626
46 GraphicsServices 0x00000001165762fe GSEventRunModal + 65
47 UIKitCore 0x000000011a669ba2 UIApplicationMain + 140
48 TheQuranApp 0x000000010deb1acb main + 75
49 libdyld.dylib 0x00000001140a2541 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Any idea. i am still checking further

@usman-whizpool
Copy link
Author

usman-whizpool commented Mar 27, 2019

my bad sorry. i was using initialization as SVGColorView()

resolved as initializing with frame

SVGColorView(frame: CGRect(x: 0, y: 0, width: 80, height: 62))

hope it will help others also

@ivanicspeter92
Copy link

my issue was resolved by updating to the current master branch version, thanks a lot!

@amarunko
Copy link
Contributor

amarunko commented Mar 27, 2019

@Usman4Github according to apple release notes of swift 5 - for current release recommended init(frame: ) initializers for UIView and NSView subclasses instead of init()

@usman-whizpool
Copy link
Author

ok great. thanks.

@ystrot ystrot closed this as completed Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants