bugly上传自定义异常(Android)
2023-01-17 本文已影响0人
霁逸lei
CrashReport.postException 上传, 8->JS脚本错误 5、6->LUA 详情见截图
int category = 8;
CrashReport.postException(category,type,error,stackTrace,extraInfo);
bugly错误类型
Android bugly异常category
CrashReport.postCatchedException上传 ,flutter 发错误堆栈string到原生,原生调用对应方法上报
按照堆栈信息重组数据,否则堆栈信息显示的是原生对应行数的Throwable
StackTraceElement stackTraceElement = new StackTraceElement(String declaringClass, String methodName,
String fileName, int lineNumber);
CrashReport.postCatchedException(new FlutterException(format,stackTraceElements));
class FlutterException extends Throwable{
public FlutterException(String message,StackTraceElement[] stackTraceElements) {
super(message);
setStackTrace(stackTraceElements);
}
}