Flutter error reports
Not every failure in a Flutter app ends in a crash. A declined payment, a response that cannot be parsed or a sync that fails silently still breaks the user's flow. With the SDK you report these non-fatal errors with a single Dart call, and Appelium automatically reports an ANR whenever the app's main thread is blocked for more than 5 seconds. Each error arrives in the Appelium Dashboard with the logs leading up to it. Mobile error reporting for iOS and Android shows how Appelium turns thousands of errors into a short list of issues.
Enable error reporting
Like all Appelium SDK features, error reporting is off by default and needs to be enabled when you start the SDK:
AppeliumFeedback.start(
apiKeys: apiKeys,
errorReporting: ErrorReportingConfiguration.enabled,
);
Report an error
AppeliumFeedback.reportError('Unable to parse response JSON');
- Reported errors are uploaded together with other session diagnostics when the app moves to the background, or on the next launch.
- The report contains the logs before the call, not a stack trace. Log the relevant state with console logs just before reporting.
- Keep the message stable and put changing values, such as IDs, in a log line instead. Errors are grouped by their message.
try {
await submitOrder(order);
} on ApiException catch (exception, stackTrace) {
AppeliumFeedback.logWarning(
'Order ${order.id} failed with HTTP ${exception.statusCode}\n$stackTrace',
domain: 'Checkout',
);
AppeliumFeedback.reportError('Order submission failed');
}
Exceptions of your Dart code are not reported automatically, so report the ones that matter where you catch them, as above.
Debugger detection
Error reporting is automatically disabled when a native debugger is attached. While debugging, reportError calls are ignored and ANR detection does not run, to avoid false positives from breakpoints.
What error reports contain
- Error message provided by the caller.
- Error timestamp at the moment the error is reported.
- Application logs from the retention period before the error.
- User identifier and backend environment, if set.
Automatic ANR detection
When error reporting is enabled, Appelium monitors the app's main thread. If it is blocked for more than 5 seconds, an error report is created automatically. It describes the ANR event and includes the stack trace of the blocked main thread.
Error grouping
Reported errors are automatically grouped on the server based on message similarity. Errors with similar messages are grouped together, making it easier to identify recurring issues and track their frequency across versions and devices.
Attach a user identifier
Attach your own identifier to find the errors of a specific user:
AppeliumFeedback.setUserIdentifier('ABC-12345');
The identifier is limited to 50 characters and applies to crash, error and bug reports. See User identifier.