Fresh SpriteKit projects with hyphens in product names do not run

Originator:Duncan.Oliver
Number:rdar://31647148 Date Originated:16-Apr-2017
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Serious Bug Reproducible:Always
 
Summary:
If you create a new SpriteKit project in Xcode with a hyphen in the name, then attempt to run it without modification, it will fail.

Steps to Reproduce:
1. Go to File > New… > Project
2. Select "Game" Under Application and hit Next
3. Set "Project Name" to a name with a hyphen
4. Make sure "Game Technology" is set to "SpriteKit"
5. Make sure "Integrate GameplayKit" is checked
6. Hit Next, then Create
7. Go to Product > Run

Expected Results:
Project starts and displays "Hello, World!"

Actual Results:
Xcode returns "signal SIGABRT" error in Thread 1 with description "Could not cast value of type 'SKScene' (0x10949c530) to '<projectname_withunderscore>.GameScene' (0x10878e700)."

Version:
Xcode Version 8.3.1 (8E1000a)
macOS Version 10.12.4 (16E195)

Notes:
A project exhibiting this problem is also attached. Explicitly setting "Module" to "withahyphen_ios" for the "Scene" node in "GameScene.sks" fixes the issue.

Configuration:
Going to "GameScene.sks" and explicitly setting the "Module" field in the Custom Class Inspector of the "Scene" node to the project name with the hyphen replaced with a underscore resolves the issue. 

Attachments:
'withahyphen-ios.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!