Swift and Spritekit won't run on device running iOS 7.1 - sprite-kit

I'm getting a really weird warning when I try to run my Swift project on my device, using Xcode 6.
The device is running iOS 7.1, and my mac is running Mavericks.
I have written a little game in Swift and SpriteKit, and it works in Simulator, but when I try to run it on my device, I get a warning, and my device only shows a black background.
I get the same result when trying to run a fresh SpriteKit project. But if I run a fresh Single Page Application using Swift, it runs normally.
This is the warning I get:
Any suggestions?

I also got this crash and, comparing to the 7.1.1 SDK SpriteKit game template, it appears to be related to loading the scene from an .sks file.
I changed it to use a different initializer like this:
let scene = GameScene(size: skView.bounds.size)
After that, the template project is not crashing anymore on my iPad mini with iOS 7.1.1. However, the plane sprites don't get rendered. You can see the node count (on the bottom right corner) go up with each tap, but the sprites aren't visible. The "Hello, World!" label shows fine, though...

Same behaviour here: default generated SpriteKit game was crashing. Now with the XCode 6 final, it all seems to work just fine, but try to add a particle emitter, and you back to XCode crashing hell. XCode keeps crashing on any particle emitter file saved as .sks file. I found that this is a known bug in XCode 6, that seems to be fixed only in 6.1 beta. See: Can't open particle SKS files

I was getting this problem too, with me it was crashing on the self.addChild(myLabel) on the default scene that loads (the one with Chalkduster "Hello, World!" and spaceships spinning on touch, I think it's called GameScene by default).
Comment out the self.addChild(myLabel) in GameScene and see if that stops the crashes. As a temporary solution I just made the viewDidLoad method load up another scene straight away and the new scene acts as you'd expect. It seems like it's something on Apples end of things, xCode6 is only in beta after all.

Try again with the latest Xcode 6 beta 4. There are still some bugs, but the basic SpriteKit template is now working fine.

Related

Xcode simulator shows up as being tiny

I am working on an iOS app in Xcode using Swift, and when I go to run the app in the simulator, it does not display as a normal simulation of the app that I am trying to run. The entire window is less than one inch by one inch, and shows what should be in the middle of the app. I ran it on my phone, and everything worked normally. Any insight into what may be going on? I'm developing the app using SpriteKit, if that provides and clues.
I have a bit of experience with iOS development, but I've never run into something like this before.
Edit: It only happens some of the time. I'm not sure, but I have a hunch that it is the result of some sort of race condition between GameScene and GameViewController
Cmd + 1 or Cmd + 2 should fix the size of the simulator (or Window -> Physical Size or Window -> Point Accurate).

Atlas images wrong size on iPad iOS 9

Since upgrading to iOS 9 I have this strange issue with image atlases in my SpriteKit game.
In my game I have a StartScene, a MenuScene and a GameScene.
In all 3 scenes I am using atlases for my enemies so I can animate them. All worked fine on all devices but since upgrading iOS 9 it causes me issues on iPads.
On my iPad when I launch the game the enemies in StartScene are about 3 times as big as they should be. Whats strange is that when I move to menuScene or gameScene the enemies are normal size.
When I tell my game to launch straight into MenuScene I have the same problem, enemies are way to big until I change to another scene.
This happened as soon as I run my game on iOS 9 and even after I upgraded to swift 2 and Xcode 7 I am still having this issue.
Anyone seeing this too, I have no clue what could cause this and how to fix it. Is this just a terrible iOS 9 bug?
Thanks for any help.
I saw there's a new option in the Xcode assets. If you click on the plus sign and select Sprite Kit Asset, you may fix the problem.
This was purely an iOS 9 bug and I believe was fixed. The initial code for my game was not doing any SKScene scaling, I did it all manually for every device, which was a terrible idea. Since asking this question I have change the way my scenes are scaled (AspectFill) so I am not 100% sure if this bug is still occurring.

TestFlight: No SKSpriteNodes

I try to test my SpriteKit Game in TestFlight. But when I install the Build via TestFlight the App just shows a gray screen with my AdMob Banner which I have integrated in the Storyboard. But it seems that the whole GameScene is not loaded.
Installing directly with the cable works fine.
Could it be related to the fact that I have deleted the GameScene.sks file?
I also get this error message some times:
I am using Xcode 6.3 and Swift 1.2
Okay, I solved the problem.
The problem was, that I deleted the GameScene.sks file. I restored the file an now it works.

Xcode 6 beta: Spritekit editor loses sprite

Been trying out the new spritekit editor in Xcode 6 beta and getting this error - I know it's beta software but I just wanted to check with others to see if anyone else is having this problem or whether I'm just going crazy...
Spritekit editor keeps losing sprites - even the demo spaceship one
Steps to Reproduce:
1. Start new xcode project using spritekit game template
2. Goto sprite kit editor and drag out spaceship onto scene
3. Click Simulate, stop - then spaceship sprite disappears from the scene and is replaced with a cross (see video showing this bug)
http://d.pr/v/XX3t
Expected Results:
Spaceship should stay
Actual Results:
Spaceship and many settings disappeared
Version:
Xcode version 6.0 (6A215l)
OS X 10.9.3 Build 13D65
Anyone else getting this problem or have a workaround?
I've been having problems with the SpriteKit scene editor in Xcode v6.0.1. After I added a node to a scene I wasn't able to select it. I tried Xcode 6.1 GM and the scene editor works a lot better. The sprite selection bug is gone and the scene refreshes in realtime as you edit it. I think your bug will be fixed too in this version.
I filed this as a bug with Apple and they acknowledged this. It appears to have been fixed now as of XCode Version 6.1.1

Cocos2d game: nothing is visible on real device

I have a Cocos2D game I want to install on my devices with Testflight. For any reason I only see a black screen when I start the project after installing via Testflight. It works fine on the simulator.
Here is the AppDelegate file: http://pastebin.com/KJwqq1us
Here is some of the code of the main menu: http://pastebin.com/9pE1drH1
The strange thing: When I add a viewController's view as a subview I see the view controller, but not the Cocos2d elements.
Would be awesome, if somebody could help me out with that problem :) Thanks in advance!
Edit:
When I install and run the game with Xcode it doesn't work as well. I tried to clean the project, delete the build folder. I create the ipa file by building for archiving -> archive -> use organizer to export as ipa file and upload this file directly to Testflight. Could the startup image cause a problem with the cocos2d layers? When I compile my application, no errors or warning are shown. No matter if I run it on the simulator in retina or non retina, it always works. On any real device it doesn't show anything related to Cocos2d like sprites or the menu
Here's a stab-in-the-dark answer as you haven't given enough details to go on....
Check the case of your graphics files and in your code match. Remember that the device IS case sensitive, but the simulator is NOT.
I fixed the blackscreen by updating the cocos2d framework to the latest beta version. I'm not sure what exactly was causing the problem