Ios AvweakReferencedDelegateStorage:委托序列化队列

Ios AvweakReferencedDelegateStorage:委托序列化队列,ios,ios10,Ios,Ios10,自从iOS 10更新以来,我目前遇到了iOS应用程序的一个新问题。此问题仅发生在iOS 10及以上版本的设备上。完整的崩溃日志如下所示: Crashed: <AVWeakReferencingDelegateStorage: 0x170229fc0> delegate serialization queue 0 libdispatch.dylib 0x18f8121e8 _os_object_retain + 72 1 libdispatch.dylib

自从iOS 10更新以来,我目前遇到了iOS应用程序的一个新问题。此问题仅发生在iOS 10及以上版本的设备上。完整的崩溃日志如下所示:

Crashed: <AVWeakReferencingDelegateStorage: 0x170229fc0> delegate serialization queue
0  libdispatch.dylib              0x18f8121e8 _os_object_retain + 72
1  libdispatch.dylib              0x18f8111c0 _dispatch_client_callout + 16
2  libdispatch.dylib              0x18f822584 _dispatch_non_barrier_sync_f_invoke + 84
3  AVFoundation                   0x1980e33ec -[AVWeakReferencingDelegateStorage getRetainedDelegate:retainedDelegateQueue:] + 168
4  AVFoundation                   0x1980e3240 -[AVWeakReferencingDelegateStorage delegate] + 36
5  AVFoundation                   0x1980ce244 -[AVCaptureVideoDataOutput _handleRemoteQueueOperation:] + 76
6  AVFoundation                   0x1980ce168 __47-[AVCaptureVideoDataOutput _updateRemoteQueue:]_block_invoke + 100
7  CoreMedia                      0x1932a0da8 __FigRemoteOperationReceiverCreateMessageReceiver_block_invoke + 260
8  CoreMedia                      0x1932c0020 __FigRemoteQueueReceiverSetHandler_block_invoke.2 + 216
9  libdispatch.dylib              0x18f8111c0 _dispatch_client_callout + 16
10 libdispatch.dylib              0x18f81e008 _dispatch_continuation_pop + 576
11 libdispatch.dylib              0x18f82a648 _dispatch_source_latch_and_call + 204
12 libdispatch.dylib              0x18f813164 _dispatch_source_invoke + 820
13 libdispatch.dylib              0x18f81f278 _dispatch_queue_serial_drain + 468
14 libdispatch.dylib              0x18f8149a8 _dispatch_queue_invoke + 652
15 libdispatch.dylib              0x18f81f278 _dispatch_queue_serial_drain + 468
16 libdispatch.dylib              0x18f8149a8 _dispatch_queue_invoke + 652
17 libdispatch.dylib              0x18f8202ac _dispatch_root_queue_drain_deferred_item + 248
18 libdispatch.dylib              0x18f826b0c _dispatch_kevent_worker_thread + 816
19 libsystem_pthread.dylib        0x18fa19174 _pthread_wqthread + 948
20 libsystem_pthread.dylib        0x18fa18db4 start_wqthread + 4
然后,segue会提示以下内容:

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self saveTestUploadImage];
}

- (void)saveTestUploadImage
{
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
        UIImage *debugImage = self.foundTestPointsImage;
        NSData *testImageData = nil;
        if (debugImage) {
            [debugImage saveImageTofileName:@"testImage.jpg"];
            testImageData = UIImageJPEGRepresentation(debugImage, 1);
        }
        if ([testImageData length] > 0) {
            PFFile *imageFile = [PFFile fileWithName:@"testImage.jpg" data:testImageData];
            [self uploadTestDataWithImage:imageFile];
        } else {
            // No Test Image Data... hmm...
            [PFAnalytics trackEvent:@"SPTestNoImageFound"];
            [self uploadTestDataWithImage:nil];
        }
    });
}
但是,它在调用saveTestUploadImage之前崩溃。
有什么想法吗?高级谢谢。

看到跟踪中的
avcapturedevideodataoutput
,您是否向plist文件添加了适当的授权
NSCameraUsageDescription
NSPhotoLibraryUsageDescription
,尤其是
NSMicrophoneUsageDescription
,它似乎会在没有正确崩溃信息的情况下使应用程序崩溃。

在跟踪中看到
avcapturedevideodataoutput
,您是否向plist文件添加了适当的授权
NSCamerauseComiption
NSPhotoLibraryUsageDescription
,尤其是
NSMicrophoneUsageDescription
,这似乎确实会导致应用程序在没有正确崩溃信息的情况下崩溃。

这是一个很好的猜测。我们必须找出一个类似的问题,我们惊讶地发现这是因为我们没有在plist中指定**Privacy:**字符串之一。感谢您的贡献。不幸的是,由于它并不是发生在所有的iOS10设备上,也不是每次都会发生(它来了又去),所以我无法测试这个理论。该应用是在应用商店的iOS 10更新之前发布的。在iOS 10之前,隐私会自动得到保护,你认为新的iOS会与旧的应用程序混淆吗?在我的例子中,应用程序总是在iOS 10设备上的新安装上崩溃。我很确定它不会在iOS10更新之前已经安装并启动了应用程序的设备上崩溃。我能够测试这个理论,但事实并非如此。谢谢你。然而,我已经解决了这个问题。这是一个线程问题。这是一个很好的猜测。我们必须找出一个类似的问题,我们惊讶地发现这是因为我们没有在plist中指定**Privacy:**字符串之一。感谢您的贡献。不幸的是,由于它并不是发生在所有的iOS10设备上,也不是每次都会发生(它来了又去),所以我无法测试这个理论。该应用是在应用商店的iOS 10更新之前发布的。在iOS 10之前,隐私会自动得到保护,你认为新的iOS会与旧的应用程序混淆吗?在我的例子中,应用程序总是在iOS 10设备上的新安装上崩溃。我很确定它不会在iOS10更新之前已经安装并启动了应用程序的设备上崩溃。我能够测试这个理论,但事实并非如此。谢谢你。然而,我已经解决了这个问题。这是一个线程问题。
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self saveTestUploadImage];
}

- (void)saveTestUploadImage
{
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
        UIImage *debugImage = self.foundTestPointsImage;
        NSData *testImageData = nil;
        if (debugImage) {
            [debugImage saveImageTofileName:@"testImage.jpg"];
            testImageData = UIImageJPEGRepresentation(debugImage, 1);
        }
        if ([testImageData length] > 0) {
            PFFile *imageFile = [PFFile fileWithName:@"testImage.jpg" data:testImageData];
            [self uploadTestDataWithImage:imageFile];
        } else {
            // No Test Image Data... hmm...
            [PFAnalytics trackEvent:@"SPTestNoImageFound"];
            [self uploadTestDataWithImage:nil];
        }
    });
}