美文网首页
RN 调用ios原生报线程错误

RN 调用ios原生报线程错误

作者: JsLin_ | 来源:发表于2018-08-29 19:37 被阅读0次

同事的iphone 5s 系统为 10.3版本 会出现闪退 报错原因如下:

accessing _cachedSystemAnimationFence requires the main thread' was thrown while invoking start on target tongdun with params ( )
导致闪退 。。。
这个错误应该是调用的时候占中线程,引起的 bug,把引起的蹦会的部分,放到主线程就好了

dispatch_async(dispatch_get_main_queue(), ^{

};

// 弹出活体检测算法界面
  dispatch_async(dispatch_get_main_queue(), ^{
    [mainViewController presentViewController:livenessDetectionViewController animated:YES completion:^{
      // 以下样例代码展示了如何初始化活体检测
      
      NSError *error;
      BOOL isSuccess;
      isSuccess = [livenessDetectionViewController setConfigLivenessDetection: weakSelf
                                                                    withError: &error];
      NSLog(@"活体检测算法初始化结果: %@", (isSuccess ? @"成功" : @"失败"));
    }];
  });

相关文章

网友评论

      本文标题:RN 调用ios原生报线程错误

      本文链接:https://www.haomeiwen.com/subject/fynkwftx.html