Sprite Kit application crashes on startup on a real device and connects to a computer

I just updated iOS10 on my test phone and Xcode 8. I ran code migration and successfully ran tests on my simulated devices.

However, as soon as I started testing on my real device, everything stopped working. After starting my Sprite Kit game for 5-10 seconds, it will work and make the phone inoperable until I disconnect it from the computer. After I disconnected from it, the game works fine and is still very smooth.

These are the launch notifications printed on 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 get after the application crashes when the phone is connected:

 /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) 
+5
source share
2 answers

try disabling the metal check by editing the circuit:

  • (Command-Option-R)
  • go to the "Settings" tab.
  • Set API check for API.

It worked for me ...

+1
source

I can solve this problem by unchecking the "Debug executable" checkbox in Scheme enter image description here

0
source

All Articles