相机随机崩溃

时间:2016-07-13 12:58:50

标签: ios iphone ios-camera

我的应用程序在99%的时间内运行良好,但在打开相机后1%它崩溃,我们随机崩溃了。这是来自Crashlytics的堆栈跟踪:

Crashed: com.apple.camera.avcapturesession
0  libobjc.A.dylib                0x194d8fbd0 objc_msgSend + 16
1  UIKit                          0x1890df21c -[UIViewAnimationState animationForLayer:forKey:forView:] + 712
2  UIKit                          0x188e55724 -[UIViewAnimationState actionForLayer:forKey:forView:] + 44
3  UIKit                          0x188e19f44 -[UIView(CALayerDelegate) actionForLayer:forKey:] + 140
4  QuartzCore                     0x188774e88 -[CALayer actionForKey:] + 104
5  QuartzCore                     0x18876a86c actionForKey(CALayer*, CA::Transaction*, NSString*) + 100
6  QuartzCore                     0x18876a6d8 CA::Layer::begin_change(CA::Transaction*, unsigned int, objc_object*&) + 176
7  QuartzCore                     0x18876d6a0 CA::Layer::setter(unsigned int, _CAValueType, void const*) + 156
8  QuartzCore                     0x188774e14 -[CALayer setOpacity:] + 48
9  UIKit                          0x188e19a5c -[UIView(Rendering) setAlpha:] + 104
10 corporate                      0x1005a3e5c -[GSDK_GTMReadMonitorInputStream .cxx_destruct]
11 corporate                      0x1005a4398 -[GSDK_GTMReadMonitorInputStream .cxx_destruct]
12 CoreFoundation                 0x184614ae4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
13 CoreFoundation                 0x184553220 _CFXNotificationPost + 2060
14 Foundation                     0x185452cc0 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
15 AVFoundation                   0x182efd9c4 -[AVCaptureSession _setRunning:] + 312
16 CameraKit                      0x18aac1adc __38-[CAMCaptureController _startPreview:]_block_invoke829
17 libdispatch.dylib              0x1953c13ac _dispatch_call_block_and_release + 24
18 libdispatch.dylib              0x1953c136c _dispatch_client_callout + 16
19 libdispatch.dylib              0x1953cb4c0 _dispatch_queue_drain + 1216
20 libdispatch.dylib              0x1953c4474 _dispatch_queue_invoke + 132
21 libdispatch.dylib              0x1953cd224 _dispatch_root_queue_drain + 664
22 libdispatch.dylib              0x1953ce75c _dispatch_worker_thread3 + 108
23 libsystem_pthread.dylib        0x19559d2e4 _pthread_wqthread + 816
24 libsystem_pthread.dylib        0x19559cfa8 start_wqthread + 4

我不完全了解此次崩溃的来源,但我发现我可能与GoogleNetworkingUtilities有关。

2 个答案:

答案 0 :(得分:3)

try this

你确定你没有做任何影响后台线程中任何UI元素的事情吗?

答案 1 :(得分:1)

如果您使用的是iOS 10,则需要将Privacy - Camera Usage Description添加到Info.plist文件中