aloisdeniel / flutter_plugin_appcenter

Flutter plugins for accessing Visual Studio App Center services.
55 stars 51 forks source link

Crash Reporting #7

Closed 01xJoao closed 4 years ago

01xJoao commented 5 years ago

Is crash reporting working ?

The only method I find is generateTestCrash and I can't pass any exception.

Regards.

ukrx-xamd commented 5 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.

yuecelm commented 5 years ago

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

ukrx-xamd commented 5 years ago

I totally agree. Hence the reason why I am also sticking with Sentry running in a zoned environment

yuecelm commented 5 years ago

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)
yuecelm commented 5 years ago

https://github.com/Microsoft/AppCenter-SDK-Android/issues/933

yuecelm commented 5 years ago

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