ghostbb
ghostbb

Reputation: 41

Spritekit app crashes when run on device, works on simulator after swift 3 conversion

My application was previously working on the device before the swift 3 conversion. It still works on simulator. Game loads on device and then after 5-6 seconds crashes.

Running 10.12.1 Beta (16B2333a), device: 10.0.2

Errors:

Metal API Validation Enabled/BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-85.83/ToolsLayers/Debug/MTLDebugRenderCommandEncoder.mm:130: failed assertion `indexBufferOffset(12) + (indexCount(372) * 2) must be <= [indexBuffer length](240).

Whether my sprite is moving or not the obstacle.sks gets halfway on to the frame before crashing. I'm aware I am going beyond my index bounds and it looks like it's having trouble reaching my metal file? I'm just not sure what to do about it. Help appreciated!

Upvotes: 1

Views: 446

Answers (3)

Jorge Paiz
Jorge Paiz

Reputation: 506

I can resolve this, unchecking "Debug executable" in the Scheme enter image description here

Upvotes: 0

ghostbb
ghostbb

Reputation: 41

This worked for me. I had to disable Metal verification by editing the scheme (Command-Option-R) is one way to get there, go to the Options tab. Set Metal API Validation to Disabled.

Upvotes: 3

Mark Brownsword
Mark Brownsword

Reputation: 2307

If you are using an Xcode beta version, then it's best to be running the same iOS beta on your device e.g. if you are making the app with Xcode public beta 2, then install iOS public beta 2 on your device.

Upvotes: 1

Related Questions