Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sprite Kit app crashes when run on real device and plugged into computer

I just updated to iOS 10 on my test phone and Xcode 8. I ran the code migration and was running tests successfully on my simulated devices.

However, once I started trying to test on my real device things stopped working smoothly. After running my Sprite Kit game for around 5 - 10 seconds it would crash and render the phone inoperable until I unplugged it from the computer. After I unplug it the game runs as normal and is still really smooth.

This are the startup notifications printed to the console:

2016-09-15 22:20:49.490959 AppName[411:38688] [DYMTLInitPlatform] platform initialization successful
2016-09-15 22:20:49.684189 AppName[411:38634] Metal GPU Frame Capture Enabled
2016-09-15 22:20:49.684758 AppName[411:38634] Metal API Validation Enabled

This is the error I receive after the app crashes when the phone is plugged in:

/BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-85.83/ToolsLayers/Debug/MTLDebugRenderCommandEncoder.mm:130: failed assertion `indexBufferOffset(12) + (indexCount(480) * 2) must be <= [indexBuffer length](960).'
(lldb) 
like image 647
Nathan Avatar asked Nov 09 '22 09:11

Nathan


1 Answers

try to disable Metal verification by editing the scheme:

  1. (Command-Option-R)
  2. go to the Options tab.
  3. Set Metal API Validation to Disabled.

This worked for me...

like image 60
Setera Avatar answered Nov 14 '22 23:11

Setera