简体   繁体   English

Spritekit 应用程序在设备上运行时崩溃,在 swift 3 转换后可在模拟器上运行

[英]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。

I can resolve this, unchecking "Debug executable" in the Scheme我可以解决这个问题,在方案中取消选中“调试可执行文件” 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Swift 应用程序在真实设备上崩溃,但在模拟器上运行 - Swift app crashes on real device but works on simulator UIImage在模拟器上运行但在设备swift上崩溃 - UIImage works on simulator but crashes on device swift 应用程式在装置上当机,但在Simulator上运作正常 - App crashes on device, however works fine on Simulator Simulator上的Xcode应用程序可以在真实设备崩溃时正常工作 - Xcode app on Simulator works, on real device crashes 应用程序在设备上崩溃,但在模拟器上不崩溃 - App Crashes on Device but Not on Simulator 在设备上运行但不在Swift的Simulator中运行时的断点 - Breakpoint when run on device but not in Simulator in Swift iOS App在Simulator上运行正常,但在真实的iOS设备上崩溃 - iOS App works fine with Simulator but Crashes with a real iOS device Xamarin应用程序在设备启动时崩溃,在模拟器中运行良好 - Xamarin app crashes on startup on device, works fine in simulator IOs App可在模拟器上运行,但在设备上崩溃(主要是使用AVFoundation) - IOs App works on simulator but crashes on device (mainly using AVFoundation) Swift UITableView在模拟器中工作,但我在设备上运行时遇到错误 - Swift UITableView works in simulator but i'm facing an error when i run it on device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM