Reputation: 1
I'm new with Swift. Before the new IOS release my game was working in Apple store. Now It can successfully build but it fail when I click on the Start button. I couldn't find anything wrong with my code.
Please check the exception below:-
exception 'NSInvalidArgumentException', reason: 'SKAction animateWithTextures: textures array cannot be empty' *** First throw call stack: ( 0 CoreFoundation 0x0000000109cca34b exceptionPreprocess + 171 1 libobjc.A.dylib 0x00000001093c521e objc_exception_throw + 48 2 CoreFoundation 0x0000000109d33265 +[NSException raise:format:] + 197 3 SpriteKit 0x000000010a7e1f81 +[SKAnimate animateWithTextures:timePerFrame:resize:restore:] + 120 4 SpriteKit 0x000000010a7ddd71 +[SKAction(SKActions) animateWithTextures:timePerFrame:] + 29 5 TwistyPlane 0x0000000108dc3aea _TFC11TwistyPlane9GameScenecfT5coderCSo7NSCoder_GSqS0 + 906 6 TwistyPlane 0x0000000108dc3c0d _TToFC11TwistyPlane9GameScenecfT5coderCSo7NSCoder_GSqS0__ + 45 7 Foundation 0x0000000108e95f12 _decodeObjectBinary + 2622 8 Foundation 0x0000000108e953c6 _decodeObject + 249 9 SpriteKit 0x000000010a84126b +[SKNode nodeWithFileNamed:] + 578 10 TwistyPlane 0x0000000108dc6fdd _TTOFCSo7SKSceneCfT9fileNamedSS_GSqS__ + 77 11 TwistyPlane 0x0000000108dc6d31 _TFC11TwistyPlane18GameViewController11viewDidLoadfT_T_ + 129 12 TwistyPlane 0x0000000108dc7032 _TToFC11TwistyPlane18GameViewController11viewDidLoadfT_T_ + 34 13 UIKit 0x000000010abcf06d -[UIViewController loadViewIfRequired] + 1258 14 UIKit 0x000000010abcf4a0 -[UIViewController view] + 27 15 UIKit 0x000000010b4938d0 -[_UIFullscreenPresentationController _setPresentedViewController:] + 87 16 UIKit 0x000000010aba9d26 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 141 17 UIKit 0x000000010abe230b -[UIViewController _presentViewController:withAnimationController:completion:] + 3956 18 UIKit 0x000000010abe56df -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 530 19 UIKit 0x000000010abe51c5 -[UIViewController presentViewController:animated:completion:] + 179 20 UIKit 0x000000010abea892 -[UIViewController _showViewController:withAction:sender:] + 274 21 UIKit 0x000000010b0af1b6 66-[UIStoryboardShowSegueTemplate newDefaultPerformHandlerForSegue:]_block_invoke + 134 22 UIKit 0x000000010b20840d -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 447 23 UIKit 0x000000010b20821d -[UIStoryboardSegueTemplate _perform:] + 82 24 UIKit 0x000000010b2084df -[UIStoryboardSegueTemplate perform:] + 156 25 UIKit 0x000000010aa2fb88 -[UIApplication sendAction:to:from:forEvent:] + 83 26 UIKit 0x000000010abb52b2 -[UIControl sendAction:to:forEvent:] + 67 27 UIKit 0x000000010abb55cb -[UIControl _sendActionsForEvents:withEvent:] + 444 28 UIKit 0x000000010abb44c7 -[UIControl touchesEnded:withEvent:] + 668 29 UIKit 0x000000010aa9d0d5 -[UIWindow _sendTouchesForEvent:] + 2747 30 UIKit 0x000000010aa9e7c3 -[UIWindow sendEvent:] + 4011 31 UIKit 0x000000010aa4ba33 -[UIApplication sendEvent:] + 371 32 UIKit 0x000000010b23db6d __dispatchPreprocessedEventFromEventQueue + 3248 33 UIKit 0x000000010b236817 __handleEventQueue + 4879 34 CoreFoundation 0x0000000109c6f311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 35 CoreFoundation 0x0000000109c5459c __CFRunLoopDoSources0 + 556 36 CoreFoundation 0x0000000109c53a86 __CFRunLoopRun + 918 37 CoreFoundation 0x0000000109c53494 CFRunLoopRunSpecific + 420 38 GraphicsServices 0x000000010ff39a6f GSEventRunModal + 161 39 UIKit 0x000000010aa2df34 UIApplicationMain + 159 40 TwistyPlane 0x0000000108dc956f main + 111 41 libdyld.dylib 0x000000010dceb68d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
Upvotes: 0
Views: 269
Reputation: 1368
It says your error in the first line "SKAction animateWithTextures: textures array cannot be empty" check your code and ensure this complaint is satisfied. It appears as though you are either calling or using an empty array for calling data. And the program crashes because there's nothing to return. That's what I see.
Upvotes: 1