简体   繁体   English

崩溃:com.apple.spritekit.renderQueue

[英]Crashed: com.apple.spritekit.renderQueue

We are developing a SpriteKit iOS7 game,the game works very well, but the game crashes when it is sent to background if we integrated any of the following libs: - Airship. 我们正在开发一个SpriteKit iOS7游戏,该游戏运行良好,但如果我们集成以下任意一个lib,则将游戏发送到后台时游戏会崩溃:-飞艇。 - Bugsense. -Bugsense。 - Apptentive. -贴心。

Here is the Crashlytics crash report: 这是Crashlytics崩溃报告:

Thread : Crashed: com.apple.spritekit.renderQueue 线程:崩溃:com.apple.spritekit.renderQueue

0  libGPUSupportMercury.dylib     0x3478b8f6 gpus_ReturnNotPermittedKillClient
1  libGPUSupportMercury.dylib     0x3478c391 gpusSubmitDataBuffers
2  IMGSGX543GLDriver              0x2ec9982d SubmitPackets
3  GLEngine                       0x320fbc3d gliPresentViewES + 172
4  OpenGLES                       0x32106139 -[EAGLContext presentRenderbuffer:] + 64
5  SpriteKit                      0x325701b1 -[SKView _renderContent] + 1216
6  libdispatch.dylib              0x3a6fdd07 _dispatch_client_callout + 22
7  libdispatch.dylib              0x3a703b9f _dispatch_barrier_sync_f_invoke + 26
8  SpriteKit                      0x3256fcc3 -[SKView renderContent] + 82
9  SpriteKit                      0x3256d663 __29-[SKView setUpRenderCallback]_block_invoke + 130
10 SpriteKit                      0x3258fddb -[SKDisplayLink _callbackForNextFrame:] + 254
11 QuartzCore                     0x3234f9cf CA::Display::DisplayLinkItem::dispatch() + 98
12 QuartzCore                     0x3234f779 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 344
13 IOMobileFramebuffer            0x34f4576d IOMobileFramebufferVsyncNotifyFunc + 104
14 IOKit                          0x30be7a75 IODispatchCalloutFromCFMessage + 248
15 CoreFoundation                 0x2fec5e21 __CFMachPortPerform + 136
16 CoreFoundation                 0x2fed09df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
17 CoreFoundation                 0x2fed097b __CFRunLoopDoSource1 + 346
18 CoreFoundation                 0x2fecf14f __CFRunLoopRun + 1398
19 CoreFoundation                 0x2fe39c27 CFRunLoopRunSpecific + 522
20 CoreFoundation                 0x2fe39a0b CFRunLoopRunInMode + 106
21 GraphicsServices               0x34b29283 GSEventRunModal + 138
22 UIKit                          0x326dd049 UIApplicationMain + 1136
23 SplishyFish                    0x000a95d1 main (main.m:16)

Apptentive, at least, doesn't make any OpenGL calls. 贴心的,至少不会进行任何OpenGL调用。 I suspect that adding the libraries to your app may just be exposing the issue that would happen in some other context (such as when there are pending events to process on the main run loop when the app is being backgrounded). 我怀疑将库添加到您的应用程序可能只是暴露了在某些其他情况下会发生的问题(例如,当应用程序处于后台时,在主运行循环中有待处理的事件要处理时)。

That said, the backtrace above is the same as the one in this thread: 也就是说,上面的backtrace与该线程中的backtrace相同:

Spritekit crashes when entering background 进入背景时Spritekit崩溃

of which there is a solution proposed here: 这里提出了一种解决方案:

Sprite Kit & playing sound leads to app termination Sprite Kit和播放声音导致应用终止

The problem there being audio playing while the app is being backgrounded. 在后台运行应用程序时播放音频的问题。 Might that be the issue? 可能是问题所在吗?

If not, the other possible culprit would be OpenGL rendering , as others have said. 如果不是这样,另一个可能的罪魁祸首就是OpenGL渲染 ,正如其他人所说的那样。

I encountered the same issue in Swift and I solved the problem with the following code: 我在Swift中遇到了相同的问题,并使用以下代码解决了该问题:

func applicationDidEnterBackground(application: UIApplication)
{
    var skView:SKView = self.window?.rootViewController?.view as! SKView
    skView.paused = true
}


func applicationWillEnterForeground(application: UIApplication)
{
    var skView:SKView = self.window?.rootViewController?.view as! SKView
    skView.paused = false        
}

I solved this in a game which is not using audio. 我在不使用音频的游戏中解决了这个问题。 Th solution is to pause SKView when entering background: 解决方法是在进入后台时暂停SKView:

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    SKView *view = (SKView *)self.window.rootViewController.view;
    if (view) {
        view.paused = YES;
    }
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    SKView *view = (SKView *)self.window.rootViewController.view;
    if (view) {
        view.paused = NO;
    }
}

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM