我已经使用了来自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];
}
请有人给我解释一下,我怎样才能读懂这一堆迹,并解决我的错误。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。