Rollbar SDK for Flutter

Quick Start

Integrating this library with your Flutter codebase requires the following steps:

  1. Add the package to your pubspec.yaml file:
  rollbar_flutter: ^1.5.0
  1. Run flutter pub get

To configure rollbar-flutter to handle all uncaught errors in your application:

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rollbar_flutter/rollbar.dart';

Future<void> main() async {
  var config = (ConfigBuilder('<YOUR ROLLBAR TOKEN HERE>')
        ..environment = 'development'
        ..codeVersion = '1.0.0'
        ..handleUncaughtErrors = true
        ..includePlatformLogs = true)

  await RollbarFlutter.run(config, (rollbar) {

class MyApp extends StatelessWidget {

When the application is running in an Android device or emulator, the Rollbar token must have the POST_CLIENT_ITEM_ACCESS_TOKEN scope.


  • Dart SDK >= 2.7.0
  • Flutter >= 1.20.0
  • A Rollbar account

Platform support

rollbar-flutter currently support Android and iOS.


Platform specific occurrence information

When handleUncaughtErrors is set to true, there will be a separate rollbar-android notifier that will handle uncaught exceptions on the Android platform side.

Android runtime exceptions thrown from a MethodChannel invocation will not be caught by rollbar-android though, since those are caught by Flutter and re-thrown on the Dart side. They will be caught and reported by the the rollbar Dart notifier.
By default the Dart exception will include the Java or Kotlin stack trace as a String in the exception message, missing some important information from the Android runtime. In order to get rollbar-android to process the exception and add its information to the occurrence, all you need to do replace the io.flutter.plugin.common.MethodChannel instance in your Android code, with com.rollbar.flutter.RollbarMethodChannel, eg.:

public class MainActivity extends FlutterActivity implements MethodChannel.MethodCallHandler {
    private static final String CHANNEL = "com.example.flutter/activity";

    public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
        new RollbarMethodChannel(

No other code changes are necessary.


When handleUncaughtErrors is set to true, there will be a separate rollbar-apple notifier initialized, which will report crashes to Rollbar.

Platform logs

Platform log collection (via Logcat on Android, and NSLog on iOS) can be enabled by setting includePlatformLogs to true in the configuration.

Note this will increase the size of the payload significantly, since log information can get very large.

Symbolication / Deobfuscation

If you use obfuscating the Dart code in your Flutter application, reported stack traces will not be very useful in most cases.

Rollbar provides a way for you to upload the symbols file generated during the obfuscation process so that stack traces can be symbolicated as they are reported.

Here is an example cURL command to upload a symbols file:

curl 'https://api.rollbar.com/api/1/fluttersymbols' \
  -F version=1.0.0 \
  -F flutter_symbols=@path/to/symbols/file

Where version matches the codeVersion set in your rollbar-flutter configuration, corresponding to the version the symbols file was generated for.

After uploading, any future reported errors for the specified version will automatically be symbolicated using the symbols file.

Flutter symbols can also be managed through the project settings page.

Help / Support

If you run into any issues, please email us at [email protected].
For bug reports, please open an issue on GitHub.