开发者社区> 问答> 正文

如何阅读和解决包的问题

我已经使用了来自Fabric的Crashlytics的本地应用程序,并且在IOS阶段得到了错误:致命异常:RCTFatalException:未处理的JS异常:JSON.strgify不能序列化循环结构。这是织物的痕迹:

Crashed: com.twitter.crashlytics.ios.exception
0  vtb.invest                     0x1049f2730 CLSProcessRecordAllThreads + 376 (CLSProcess.c:376)
1  vtb.invest                     0x1049f2b18 CLSProcessRecordAllThreads + 407 (CLSProcess.c:407)
2  vtb.invest                     0x1049e2838 CLSHandler + 26 (CLSHandler.m:26)
3  vtb.invest                     0x1049f0d50 __CLSExceptionRecord_block_invoke + 199 (CLSException.mm:199)
4  libdispatch.dylib              0x197a96184 _dispatch_client_callout + 16
5  libdispatch.dylib              0x197a79dd8 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  vtb.invest                     0x1049f07f8 CLSExceptionRecord + 206 (CLSException.mm:206)
7  vtb.invest                     0x1049f062c CLSExceptionRecordNSException + 102 (CLSException.mm:102)
8  vtb.invest                     0x1049f0250 CLSTerminateHandler() + 259 (CLSException.mm:259)
9  vtb.invest                     0x104764bc0 CPPExceptionTerminate() + 392
10 libc++abi.dylib                0x197b96304 std::__terminate(void (*)()) + 16
11 libc++abi.dylib                0x197b9629c std::terminate() + 44
12 libobjc.A.dylib                0x197af12dc _objc_terminate() + 10
13 libdispatch.dylib              0x197a96198 _dispatch_client_callout + 36
14 libdispatch.dylib              0x197a7373c _dispatch_lane_serial_drain$VARIANT$armv81 + 564
15 libdispatch.dylib              0x197a74154 _dispatch_lane_invoke$VARIANT$armv81 + 400
16 libdispatch.dylib              0x197a7d43c _dispatch_workloop_worker_thread + 576
17 libsystem_pthread.dylib        0x197ae5fa4 _pthread_wqthread + 276
18 libsystem_pthread.dylib        0x197ae8ae0 start_wqthread + 8

问题的详细信息来自此文件RCTAssert.m第163行和RCTFormatError,来自以下方法:

NSString *RCTFormatError(NSString *message, NSArray<NSDictionary<NSString *, id> *> *stackTrace, NSUInteger maxMessageLength)
{
  if (maxMessageLength > 0 && message.length > maxMessageLength) {
    message = [[message substringToIndex:maxMessageLength] stringByAppendingString:@"..."];
  }

  NSMutableString *prettyStack = [NSMutableString string];
  if (stackTrace) {
    [prettyStack appendString:@", stack:\n"];

    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\b((?:seg-\\d+(?:_\\d+)?|\\d+)\\.js)"
                                                                           options:NSRegularExpressionCaseInsensitive
                                                                             error:NULL];
    for (NSDictionary<NSString *, id> *frame in stackTrace) {
      NSString *fileName = [frame[@"file"] lastPathComponent];
      NSTextCheckingResult *match = fileName != nil ? [regex firstMatchInString:fileName options:0 range:NSMakeRange(0, fileName.length)] : nil;
      if (match) {
        fileName = [NSString stringWithFormat:@"%@:", [fileName substringWithRange:match.range]];
      } else {
        fileName = @"";
      }

      [prettyStack appendFormat:@"%@@%@%@:%@\n", frame[@"methodName"], fileName, frame[@"lineNumber"], frame[@"column"]];
    }
  }

  return [NSString stringWithFormat:@"%@%@", message, prettyStack];
}

请有人给我解释一下,我怎样才能读懂这一堆迹,并解决我的错误。

展开
收起
游客5akardh5cojhg 2019-12-04 14:41:41 547 0
0 条回答
写回答
取消 提交回答
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
《Java开发手册》2019最新版发布! 立即下载
阿里巴巴Java开发手册PDF1.2.0版(非最新版) 立即下载
阿里巴巴Java开发手册PDF1.1.0版(非最新版) 立即下载