Xcode 9 Crash on texture settings in SKScene in Spritekit

I am currently creating a game in Spritekit with Xcode. After upgrading to Xcode 9, I found that every time I set the texture through the sks file, Xcode works instantly. I restarted my computer, updated the application, rebooted the textures and changed nothing. I have a 199-inch Macbook Prof 13 "with touchpad. Here are the diagnostics:

Process: Xcode [577] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 9.0.1 (13249) Build Info: IDEFrameworks-13249000000000000~2 App Item ID: 497799835 App External ID: 823984564 Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Xcode [577] User ID: 501 Date/Time: 2017-10-22 17:30:06.029 -0400 OS Version: Mac OS X 10.12.6 (16G29) Report Version: 12 Anonymous UUID: 0537A8C3-9FB2-836A-088B-E5D2B7FEB3EB Time Awake Since Boot: 100 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: SKCRenderer_resource_queue Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x000000012ceef7b8 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Bus error: 10 Termination Reason: Namespace SIGNAL, Code 0xa Terminating Process: exc handler [0] VM Regions Near 0x12ceef7b8: MALLOC_LARGE 000000012ceaf000-000000012ceef000 [ 256K] rw-/rwx SM=PRV --> mapped file 000000012ceef000-000000012cf22000 [ 204K] r--/rw- SM=COW MALLOC_LARGE 000000012cf31000-000000012cf71000 [ 256K] rw-/rwx SM=PRV Application Specific Information: Sending userDidChangeValue: to <SKInspectorTextureProperty: 0x7fadb2219440> from <NSComboBox: 0x7fadb221ad80> ProductBuildVersion: 9A1004 Performing @selector(userDidChangeValue:) from sender NSComboBox 0x7fadb221ad80 
+12
source share
10 answers

I solved the problem with the crash.

The problem is your @ 2x and @ 3x images. With those present in the Assets.xcassets - SKS node folder, XCODE will crash.

  • Add ONLY 1x image to Assets.xcassets folder.
  • put the node color on your SKS scene.
  • select texture
  • resize texture.
  • add your @ 2x and @ 3x files later.

This solution works 100% every time.

+9
source

OHM, I found the reason. This will happen if your image does not equal the ratio of the current skspritenode size on the storyboard. Good luck!

+2
source

I found that cleaning the assembly worked once and before I put the images in Photoshop and exported them as PNG, then put them in the resources folder and it seemed to work for a while. But since Mojave and the latest Xcode update seem to no longer work. I already submitted 3 Apple crash reports, and it took me about an hour to get 2 sprites with the correct textures on the screen. I don't want to sound rude, but Apple should stop being a bunch of oranges on it, and get fixed as soon as possible!

+2
source

I found a workaround that may or may not work, it is not reliable, but still better than not working at all. I created an empty SKS file and installed all my textures in this file. Then I copied and pasted node into the preferred SKS file.

+1
source

There is a great workaround on Apple forums.

How to fix the .sks file:

  • Open the .sks file outside the project (close the project and open the file directly from Finder)

  • You should see red crosses instead of sprites, delete information about the name of the texture for all of them.

  • Now you can open the file from the project again.

  • Finally, re-enter the texture name for all of your sprites.

+1
source

I had this problem with only one of my sprite textures causing the Xcode sprite editor to crash (even after deleting @ 2x and @ 3x images). It had a 300 dpi DPI image. I changed it to 72 ppi, which matches other sprite textures. No more wreck.

I hope this helps someone. This bug in the Xcode sprite editor exists for quite a few versions of Xcode and is a real productivity killer. Keep sending bug reports to the apple.

+1
source

Separate the metadata from the image before setting it as a texture.

For example, using ImageMagick :

 convert oldImage.png -strip newImage.png 
+1
source

Based on what others are saying, and that it seems to me to fix this problem, I believe that the problem is that the resolution of the images is too large to handle the visual editor. I had images that were much larger than my scene (albeit at 72 PPI), and each time I got the same crash, but when I resized them to be smaller, there were no more problems, and that’s all It seemed to load faster (before, it would take several seconds to load the textures). I also used ImageOptim to delete EXIF ​​data.

I have passed Apple Dev Support messages and I will update my answer if they respond to anything useful.

0
source

I had .xcassets and the same problem, and what worked for me was to get around all .xcassets . I just added a folder to my project and imported the images into a folder. After that, the texture assignment in the scene editor no longer crashed Xcode

0
source

I think this is related to your computer: MacBook Pro (13-inch, 2017), which is also my workstation.

I tested the same project (just created by a game template with an identical texture image) on the following computers with Mojave 10.14 and Xcode 10.1 installed:

Mac mini server (later 2012) iMac, 27 (mid 2011) MacBook Pro 13 (mid 2014) MacBook Air 13 (mid 2014) MacBook Pro 15 (mid 2014). All of the above computers work well.

Another weird thing happens when I design my MacBook Pro (13 inches, 2017) through AirPlay, it no longer crashes.

0
source

Source: https://habr.com/ru/post/1272813/


All Articles