[英]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.在 swift 3 转换之前,我的应用程序以前在设备上运行。 It still works on simulator.它仍然适用于模拟器。 Game loads on device and then after 5-6 seconds crashes.游戏在设备上加载,然后在 5-6 秒后崩溃。
Running 10.12.1 Beta (16B2333a), device: 10.0.2运行 10.12.1 Beta (16B2333a),设备: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.无论我的精灵是否在移动,障碍物.sks 在崩溃之前都会到达框架的一半。 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!帮助表示赞赏!
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.我必须通过编辑方案(Command-Option-R)来禁用金属验证,这是一种方法,请转到“选项”选项卡。 Set Metal API Validation to Disabled.将 Metal API 验证设置为禁用。
如果您使用的是 Xcode 测试版,那么最好在您的设备上运行相同的 iOS 测试版,例如,如果您使用 Xcode 公开测试版 2 制作应用程序,则在您的设备上安装 iOS 公开测试版 2。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.