Sentry Dart Plugin

Sentry Dart Plugin pub package pub points

A Dart Build Plugin that uploads debug symbols for Android, iOS/macOS and source maps for Web to Sentry via sentry-cli.

For doing it manually, please follow our docs.

:clipboard: Install

In your pubspec.yaml, add sentry_dart_plugin as a new dev dependency.

  sentry_dart_plugin: ^1.0.0-beta.1

Build App

The flutter build apk, flutter build ios (or macos) or flutter build web is required before executing the sentry_dart_plugin plugin, because the build spits out the debug symbols and source maps.



dart run sentry_dart_plugin


flutter packages pub run sentry_dart_plugin

Configuration (Optional)

This tool comes with a default configuration. You can configure it to suit your needs.

Add sentry: configuration at the end of your pubspec.yaml file:

  upload_native_symbols: true
  upload_source_maps: false
  include_native_sources: false
  project: ...
  org: ...
  auth_token: ...
  url: ...
  wait_for_processing: false
  log_level: error # possible values: trace, debug, info, warn, error
  release: ...
  web_build_path: ...
  commits: auto

Available Configuration Fields

Configuration NameDescriptionDefault Value And TypeRequiredAlternative Environment variable
upload_native_symbolsEnables or disables the automatic upload of debug symbolstrue (boolean)no-
upload_source_mapsEnables or disables the automatic upload of source mapsfalse (boolean)no-
include_native_sourcesDoes or doesn't include the source code of native codefalse (boolean)no-
projectProject's namee.g. sentry-flutter (string)yesSENTRY_PROJECT
orgOrganization's sluge.g. sentry-sdks (string)yesSENTRY_ORG
auth_tokenAuth Tokene.g. 64 random characteres (string)yesSENTRY_AUTH_TOKEN
urlURLe.g. https://mysentry.invalid/ (string)noSENTRY_URL
wait_for_processingWait for server-side processing of uploaded filesfalse (boolean)no-
log_levelConfigures the log level for sentry-cliwarn (string)noSENTRY_LOG_LEVEL
releaseThe release version for source maps, it should match the release set by the SDKdefault: name@version from pubspec (string)noSENTRY_RELEASE
web_build_pathThe web build folderdefault: build/web (string)no-
commitsRelease commits integrationdefault: autono-


Sentry's auth_token requires the project:releases or project:write scope, See docs.

Dart's --obfuscate option is required to be paired with --split-debug-info to generate a symbol map, See docs.

The --split-debug-info option requires setting a output directory, the directory must be an inner folder of the project's folder, See docs.

Flutter's build web command requires setting the --source-maps parameter to generate source maps, See Issue