gpt4 book ai didi

ios - iOS 拍摄应用程序快照时崩溃

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:12:29 25 4
gpt4 key购买 nike

更新:2016 年 4 月 14 日:仍然在 Fabric Crashlytics 中看到这些崩溃,但仍然不确定我将如何修复。似乎是 0.2% 的 session 崩溃率。


据我所知,当 Apple 拍摄快照时,我的应用偶尔会崩溃(因为下面的代码片段在崩溃日志中)。但是,我不确定如何才能阻止它崩溃。

[UIApplication _updateSnapshotAndStateRestorationArchiveForBackgroundEvent:saveState:exitIfCouldNotRestoreState:]

我在 SO 上找到了一些其他帖子,但我没有使用任何类型的 WebView ( post ),没有使用任何广告,并在主线程中调用 completionHandler。等其他人似乎也遇到类似的问题,但他们的post仍然没有答案。整个崩溃日志如下。这是 Apple 内部的错误,还是我可以修复的错误?

Thread : Crashed: com.apple.main-thread
0 libsystem_platform.dylib 0x1812962a0 _platform_memmove + 176
1 CoreFoundation 0x181544ed8 CFDataGetBytes + 172
2 CoreFoundation 0x181544ed8 CFDataGetBytes + 172
3 ImageIO 0x182cb599c CGImageReadGetBytesAtOffset + 624
4 ImageIO 0x182cb570c CGImageReadSessionGetBytes + 36
5 ImageIO 0x182d89acc iioReadCallback + 32
6 AppleJPEG 0x182c8bd04 aj_istream_move_to_position + 488
7 AppleJPEG 0x182c8c968 aj_istream_state_restore + 60
8 AppleJPEG 0x182c9b64c applejpeg_decode_set_ra_table + 804
9 ImageIO 0x182d8e1e0 copyImageBlockSetAppleJPEG + 6524
10 ImageIO 0x182cbf130 ImageProviderCopyImageBlockSetCallback + 852
11 QuartzCore 0x183d5ae0c CA::Render::create_image(CGImage*, CGColorSpace*, unsigned int) + 972
12 QuartzCore 0x183d59eec CA::Render::copy_image(CGImage*, CGColorSpace*, unsigned int, double) + 372
13 QuartzCore 0x183d32f00 -[CALayer(CALayerPrivate) _copyRenderLayer:layerFlags:commitFlags:] + 484
14 QuartzCore 0x183d32c54 CA::Context::commit_layer(CA::Layer*, unsigned int, unsigned int, void*) + 108
15 QuartzCore 0x183d2f9cc CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 392
16 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
17 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
18 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
19 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
20 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
21 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
22 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
23 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
24 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
25 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
26 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
27 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
28 QuartzCore 0x183d2f95c CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 280
29 QuartzCore 0x183d2d0cc CA::Context::commit_transaction(CA::Transaction*) + 1332
30 QuartzCore 0x183d2c9dc CA::Transaction::commit() + 512
31 UIKit 0x1865ab768 _UIWindowUpdateVisibleContextOrder + 236
32 UIKit 0x1865ab5b4 +[UIWindow _prepareWindowsPassingTestForAppResume:] + 32
33 UIKit 0x1865e1468 __114-[UIApplication _updateSnapshotAndStateRestorationArchiveForBackgroundEvent:saveState:exitIfCouldNotRestoreState:]_block_invoke_3 + 72
34 libdispatch.dylib 0x181089630 _dispatch_call_block_and_release + 24
35 libdispatch.dylib 0x1810895f0 _dispatch_client_callout + 16
36 libdispatch.dylib 0x18108ecf8 _dispatch_main_queue_callback_4CF + 1844
37 CoreFoundation 0x1815ecbb0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
38 CoreFoundation 0x1815eaa18 __CFRunLoopRun + 1628
39 CoreFoundation 0x181519680 CFRunLoopRunSpecific + 384
40 GraphicsServices 0x182a28088 GSEventRunModal + 180
41 UIKit 0x186390d90 UIApplicationMain + 204
42 MyApp 0x100095888 main (main.m:16)
43 libdispatch.dylib 0x1810ba8b8 (Missing)

最佳答案

可以肯定的是,某个地方的某些东西正在后台线程上触发 UIKit 操作。准确地找到什么……嗯,这是一个技巧。运气好的话,this gist may be of help .

This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.

如果您的应用中有任何广告显示 SDK,那将是一个很好的初步怀疑。他们有一个令人沮丧的习惯,即在将 UI 操作正确限制在主线程方面绝对糟糕。

关于ios - iOS 拍摄应用程序快照时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36174620/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com