Closed 01xJoao closed 4 years ago
This is working - somewhat - you can intercept Flutter crashes by running your main app in a Zoned sandbox - then you can provide an onError callback whereby you would simply log using AppCenterAnalytics - i.e log the error and stackTrace via a trackEvent call.
is it possible to provide a method like captureException?
FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack);
};
runZoned<Future<void>>(() async {
// start your app
}, onError: (error, stackTrace) {
AppCenterCrashes.captureException(
exception: error,
stackTrace: stackTrace,
);
});
misusing AppCenterAnalytics for crash reporting looks like a hack for me and is currently a reason why I cannot switch from sentry to appcenter
I totally agree. Hence the reason why I am also sticking with Sentry running in a zoned environment
it seems to be a limitation of the AppCenter SDK:
// TODO the backend does not support that service yet, will be public method later.
static void trackException(@NonNull Throwable throwable)
please upvote in https://github.com/Microsoft/AppCenter-SDK-Android/issues/938 if you want to support flutter in appcenter and to speed up solving this issue
Is crash reporting working ?
The only method I find is generateTestCrash and I can't pass any exception.
Regards.