PGSSoft / ParallaxView

tvOS controls and extensions that add parallax effect to your application.
https://pgssoft.github.io/ParallaxView/
MIT License
483 stars 51 forks source link

Fix exception when loading gloweffect asset #5

Closed dcordero closed 7 years ago

dcordero commented 7 years ago

Defining the gloweffect asset as universal crashes on Xcode 9. This PR defines gloweffect asset as a tvOS asset.

Backtrace:

fatal error: Can't initialize gloweffect image: file /Users/dcordero/Sources/ParallaxView/Sources/Other/ParallaxEffectOptions.swift, line 59
2017-06-07 09:54:56.024157-0700 ParallaxViewExample[52498:1230620] fatal error: Can't initialize gloweffect image: file /Users/dcordero/Sources/ParallaxView/Sources/Other/ParallaxEffectOptions.swift, line 59
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    frame #0: 0x000000010726d980 libswiftCore.dylib`function signature specialization <preserving fragile attribute, Arg[1] = Exploded> of Swift._assertionFailure(Swift.StaticString, Swift.String, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 144
  * frame #1: 0x0000000104021d70 ParallaxView`static ParallaxEffectOptions.defaultGlowImageView(self=ParallaxView.ParallaxEffectOptions) at ParallaxEffectOptions.swift:59
    frame #2: 0x0000000104021f3f ParallaxView`ParallaxEffectOptions.init(parallaxSubviewsContainer=nil, glowContainerView=nil) at ParallaxEffectOptions.swift:33
    frame #3: 0x0000000104023d15 ParallaxView`ParallaxView.init(aDecoder=0x00007ff7b2852000) at ParallaxView.swift:14
    frame #4: 0x0000000104023fff ParallaxView`@objc ParallaxView.init(coder:) at ParallaxView.swift:0
    frame #5: 0x0000000103d09672 ParallaxViewExample`CustomParallaxView.init(aDecoder=0x00007ff7b2852000) at ViewController.swift:0
    frame #6: 0x0000000103d0971f ParallaxViewExample`@objc CustomParallaxView.init(coder:) at ViewController.swift:0
    frame #7: 0x0000000105755fa4 UIKit`-[UIClassSwapper initWithCoder:] + 246
    frame #8: 0x000000010597c318 UIKit`UINibDecoderDecodeObjectForValue + 693
    frame #9: 0x000000010597c058 UIKit`-[UINibDecoder decodeObjectForKey:] + 89
    frame #10: 0x0000000105755c70 UIKit`-[UIRuntimeConnection initWithCoder:] + 178
    frame #11: 0x000000010597c318 UIKit`UINibDecoderDecodeObjectForValue + 693
    frame #12: 0x000000010597c4b6 UIKit`UINibDecoderDecodeObjectForValue + 1107
    frame #13: 0x000000010597c058 UIKit`-[UINibDecoder decodeObjectForKey:] + 89
    frame #14: 0x0000000105754e6d UIKit`-[UINib instantiateWithOwner:options:] + 1262
    frame #15: 0x00000001054d6bee UIKit`-[UIViewController _loadViewFromNibNamed:bundle:] + 383
    frame #16: 0x00000001054d74f7 UIKit`-[UIViewController loadView] + 177
    frame #17: 0x00000001054d7846 UIKit`-[UIViewController loadViewIfRequired] + 195
    frame #18: 0x00000001054d80a3 UIKit`-[UIViewController view] + 27
    frame #19: 0x000000010553962d UIKit`-[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 466
    frame #20: 0x0000000105538a05 UIKit`-[UITabBarController transitionFromViewController:toViewController:] + 59
    frame #21: 0x0000000105534a3e UIKit`-[UITabBarController _setSelectedViewController:] + 410
    frame #22: 0x000000010553480d UIKit`-[UITabBarController setSelectedViewController:] + 109
    frame #23: 0x0000000105410150 UIKit`+[UIView(Animation) performWithoutAnimation:] + 90
    frame #24: 0x000000010552e735 UIKit`-[UITabBarController _selectDefaultViewControllerIfNecessaryWithAppearanceTransitions:] + 512
    frame #25: 0x000000010552fd4a UIKit`-[UITabBarController viewWillAppear:] + 207
    frame #26: 0x00000001054dd7e8 UIKit`-[UIViewController _setViewAppearState:isAnimating:] + 444
    frame #27: 0x00000001054ddfe5 UIKit`-[UIViewController __viewWillAppear:] + 147
    frame #28: 0x00000001054df748 UIKit`-[UIViewController viewWillMoveToWindow:] + 507
    frame #29: 0x00000001054065ef UIKit`-[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 657
    frame #30: 0x0000000105417760 UIKit`-[UIView(Internal) _addSubview:positioned:relativeTo:] + 440
    frame #31: 0x00000001053c40ee UIKit`-[UIWindow addRootViewControllerViewIfPossible] + 841
    frame #32: 0x00000001053c4511 UIKit`-[UIWindow _setHidden:forced:] + 294
    frame #33: 0x00000001053d6e17 UIKit`-[UIWindow makeKeyAndVisible] + 42
    frame #34: 0x000000010534f838 UIKit`-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4711
    frame #35: 0x0000000105354c53 UIKit`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1699
    frame #36: 0x00000001056a8f5b UIKit`__111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 111
    frame #37: 0x0000000105a1d5fb UIKit`+[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    frame #38: 0x00000001056a8e81 UIKit`-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
    frame #39: 0x00000001056a921d UIKit`-[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 530
    frame #40: 0x0000000105f097be UIKit`__82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 259
    frame #41: 0x0000000105f0967a UIKit`-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
    frame #42: 0x0000000105c47287 UIKit`__125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
    frame #43: 0x0000000105e1a9fe UIKit`_performActionsWithDelayForTransitionContext + 100
    frame #44: 0x0000000105c4714a UIKit`-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
    frame #45: 0x0000000105a1cc58 UIKit`-[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    frame #46: 0x000000010535351b UIKit`-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 664
    frame #47: 0x000000010587ca31 UIKit`-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
    frame #48: 0x000000010d1be628 FrontBoardServices`-[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
    frame #49: 0x000000010d1c7085 FrontBoardServices`__56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
    frame #50: 0x000000010d1f2853 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    frame #51: 0x000000010d1f2509 FrontBoardServices`-[FBSSerialQueue _performNext] + 464
    frame #52: 0x000000010d1f2a78 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 45
    frame #53: 0x00000001085161d1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #54: 0x00000001084fa9ef CoreFoundation`__CFRunLoopDoSources0 + 271
    frame #55: 0x00000001084f9f9f CoreFoundation`__CFRunLoopRun + 1039
    frame #56: 0x00000001084f9919 CoreFoundation`CFRunLoopRunSpecific + 409
    frame #57: 0x000000010ba649d7 GraphicsServices`GSEventRunModal + 62
    frame #58: 0x0000000105356727 UIKit`UIApplicationMain + 159
    frame #59: 0x0000000103d0c077 ParallaxViewExample`main at AppDelegate.swift:12
    frame #60: 0x0000000109706eb9 libdyld.dylib`start + 1
(lldb)
nonameplum commented 7 years ago

Thank you for your contribution 👍

tmm1 commented 7 years ago

Hi, can you share a backtrace or other info about the crash so it's easier to google for others who hit the same issue?

dcordero commented 7 years ago

@tmm1 good point 👍 I have edited the PR description adding the bt