8

I've downloaded macOS Sierra 10.12 and put it into an VMWare machine. Everything running well, but at xCode, using SpriteKit, whenever I try to open the GameScene.sks file (to put the origin point (0, 0) at the bottom, just like it was before xCode 8), the program crashes immediately.

Using VMWare Pro 12; Tried both with xCode 8.1 and 8.2 Beta, same crash.

I know theres many cases as mine, but its just annoying that this have no solution. I found this in my VERY DEEP google search, but that solution is not a solution for me, because VMware doesn't let you put an gpu to work with the VM(I have intel hd 4600 + gtx 960).

I can open action sks files normally. Seems like only GameScene.sks gives me a crash, so:

Theres a way to fix it? If not, can I edit the GameScene.sks file or just put origin point at the bottom without xCode? If not either, can I download an previous xCode version without developer license?

Well, the last thing I could do is to make an dual boot here in my PC, but I think its not so easy as it seems

Xcodian Solangi
  • 2,342
  • 5
  • 24
  • 52
Lucas
  • 81
  • 1
  • 3
  • 1
    as a side note... .sks file editing in the Scene Editor is slow, buggy, problematic and fraught with hoop jumping, even on a top-of-the-line Apple computer, on a good day. I'm a designer, and inclined towards visual editing... but I'm doing EVERYTHING in code with SpriteKit... and I'm not alone. That's how bad the Scene Editor is. Apple should have made a separate app (outside Xocde) for editing scenes and particles of SceneKit, SpriteKit and their compatriot GameplayKit. Bundling it all together is ridiculous, at best. – Confused Dec 01 '16 at 15:45
  • Yes it is... as an iOs user I took that developing it was easy and simple, but my first 10 hours was googling for an unsolved issue that seems to happen since xCode 6. You can see at the Appstore that so MANY people are giving 1-star to this xCode 8. Pretty bad for the first try, but i'll try to get over this. – Lucas Dec 01 '16 at 18:20
  • The scene editor is definitely not as bad as Confused is making it out to be. XCode makes use of mac only hardware, so VMs and hackintoshes will be more susceptible to crashing. Find someone with a real mac, give them your project, and see if it crashed on them as well. – Knight0fDragon Dec 01 '16 at 18:28
  • 2
    I did it just before reading your comment. Asked a friend to download xCode 8.1 in app store, make a new project and open GameScenes.sks: Crash! – Lucas Dec 01 '16 at 19:36
  • @Lucas Totally agree with Confused. Apple fight against different hardware sometimes forgot to handle errors that warn users to don't use 3d part GPU's with Xcode (crash a project could means losing lines of code..), if you have SKS crashes and different HW try to launch also Open Developer Tools - Instruments and you can see other errors (transparent tools..). My personal advice to your particular condition is to do everything in code and if you must work with emitters or ODT, download XCode 7,rename it with Xcode7.app and use it just for these SKS – Alessandro Ornano Dec 02 '16 at 09:09
  • @Lucas, you made a new project and it crashed? This is very interesting now, because it does not crash for me. – Knight0fDragon Dec 02 '16 at 15:29
  • @Lucas what is the OS version? – Knight0fDragon Dec 02 '16 at 15:48
  • @AlessandroOrnano, I do not think you can 'legally' (As far as apple is concerned) use 3rd party GPUs anymore. The only desktop model I know of still in production from apple is the iMac, and that doesnt allow upgrading, but I may be wrong on this if somebody knows something different. – Knight0fDragon Dec 02 '16 at 15:50
  • @Lucas, I am on Mavericks still, so if your friend is also on Sierra, this may be where the problem lies – Knight0fDragon Dec 02 '16 at 17:06
  • @Alessandro ill try it asap. Knight: Both i've tested was on Sierra... theres a lot of complains about it in the developers forum. Many with Sierra too. Yes, even with a new project it crashes. I'll try to instal El Capitain to see if something changes. If i do, i'll edit here. – Lucas Dec 04 '16 at 17:41

3 Answers3

11

Xcode 8:

Finally I found a solution for this issue! You have to re-code-sign Xcode 8 and it's components to make it work.

Some of these applications are flagged so they refuse to load libraries that are not signed by Apple. The Nvidia Web Driver is not signed by Apple, so it's not loaded, resulting in the behavior you describe. (See this thread)

I'm using an nVidia GPU only, and it caused the issue - at least for me. Quit XCode and run these commands in Terminal one by one:

sudo codesign -f -s - /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/MacOS/Instruments
sudo codesign -f -s - /Applications/Xcode.app/Contents/Applications/FileMerge.app/Contents/MacOS/FileMerge
sudo codesign -f -s - /Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/MacOS/Application\ Loader 
sudo codesign -f -s - /Applications/Xcode.app/Contents/Applications/Accessibility\ Inspector.app/Contents/MacOS/Accessibility\ Inspector 
sudo codesign -f -s - /Applications/Xcode.app/Contents/MacOS/Xcode 

The last command took ages to finish for me so I terminated the process by quiting Terminal. Even so it did the trick and next time I launched XCode some popup appeared like: Xcode wants to use your information stored in your Keychain. I choose "Always Allow" for each dialog. (next time you open XCode these dialogs won't appear)

After all I selected GameScene.sks file from the project navigator and XCode didn't crash.

Since then, it's working perfectly! :)

You have to redo the steps above if you upgrade XCode 8 to a newer Xcode 8 release! This method reportedly doesn't work in XCode 9 beta, will update this post if it changes..

Xcode 9:

If you have a hackintosh, the cleanest way to fix these nVidia bugs is to install NVWebDriverLibValFix.kext. If you're using Clover as the bootloader, place the downloaded kext file in EFI/EFI/Clover/kexts/Other. Installing the kext with KextBeast should also work, but I prefer using Clover for kext injection.

balazs630
  • 3,421
  • 29
  • 46
  • 2
    This is the right answer sir, congrats on finding that! – Francis-Olivier Couture May 22 '17 at 17:18
  • balazs630 -> your fix worked great for all things except for Particle System previews (both in sks files and in stand alone scnp files). Nothing is showing up. Do you have any idea how to address that? – Ryan Pfister Jul 07 '17 at 15:52
  • 1
    I have a SpriteKit Particle File (Emitter) in one of my project and it works great with preview. Did you check this Xcode project on another Mac if the preview works or not? – balazs630 Jul 08 '17 at 13:10
  • 1
    Yes! It worked! I mean, it doesn't work in xcode 9 beta 2, but it works in xcode 8! Wahoo! I'm not sure if it is a bug in xcode 9 or what (since it's prerelease), but it works in xcode 8. Thank you good sir! – Ryan Pfister Jul 10 '17 at 01:31
  • I tried this, but it does not work for me. Then I found a post on Reddit saying on enabling the integrated graphics on motherboard could fix it. So I did that, and now it works. – TonyW Dec 10 '17 at 06:35
0

I can't help with your crash, but you can change the Anchor Point within code like this...

GameScene.swift

override func viewDidLoad(){
    self.anchorPoint = CGPoint(0,0)
}
TheValyreanGroup
  • 3,554
  • 2
  • 12
  • 30
  • 1
    For some reason xCode is sayng "Method doesnt override any method from its superclass." Code: `self.anchorPoint = CGPoint(x: 0, y: 0) ` – Lucas Dec 01 '16 at 18:58
  • Full code: `class GameScene: SKScene { var Ground = SKSpriteNode() var Ghost = SKSpriteNode() override func viewDidLoad() { self.anchorPoint = CGPoint(x: 0, y: 0) } ` – Lucas Dec 01 '16 at 19:09
  • Sorry, don't use the override for viewDidLoad, that's in a UIKit view. Just put the setting to anchorPoint somewhere in your class before you need it. – TheValyreanGroup Dec 01 '16 at 20:37
  • 1
    use `didMove(to:)` – Knight0fDragon Dec 02 '16 at 15:48
0

What worked for me (I ran into the problem after upgrading macOS to Mojave, and the Xcode contained therein) was to disable all of the Xcode plugins!

:-)

Mojtaba Hosseini
  • 95,414
  • 31
  • 268
  • 278