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

Overview

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.

πŸ“‹ Install

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

dev_dependencies:
  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.

Run

Dart

dart run sentry_dart_plugin

Flutter

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:

sentry:
  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: ...
Available Configuration Fields:
Configuration Name Description Default Value And Type Required Alternative Environment variable
upload_native_symbols Enables or disables the automatic upload of debug symbols true (boolean) no -
upload_source_maps Enables or disables the automatic upload of source maps false (boolean) no -
include_native_sources Does or doesn't include the source code of native code false (boolean) no -
project Project's name e.g. sentry-flutter (string) yes SENTRY_PROJECT
org Organization's slug e.g. sentry-sdks (string) yes SENTRY_ORG
auth_token Auth Token e.g. 64 random characteres (string) yes SENTRY_AUTH_TOKEN
url URL e.g. https://mysentry.invalid/ (string) no SENTRY_URL
wait_for_processing Wait for server-side processing of uploaded files false (boolean) no -
log_level Configures the log level for sentry-cli warn (string) no SENTRY_LOG_LEVEL
release The release version for source maps, it should match the release set by the SDK default: name@version from pubspec (string) no -
web_build_path The web build folder default: build/web (string) no -

Troubleshooting

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.

The --split-debug-info and --obfuscate are not supported for iOS and Desktop Apps yet, See docs

Comments
  • Source Maps does not works with Flutter Web

    Source Maps does not works with Flutter Web

    Environment

    Flutter SDK version

    "flutterSdkVersion": "3.0.5"

    sentry_dart_plugin version:

    sentry_dart_plugin: ^1.0.0-beta.1

    stdout: > Found 3631 release files
    > Analyzing 3631 sources
    > Rewriting sources
    > Adding source map references
    > Bundled 3631 files for upload
    > Uploaded release files to Sentry
    > File upload complete (processing pending on server)
    > Organization: novade
    > Project: novade
    > Release: [email protected]+63
    > Dist: 63
    

    Steps to Reproduce

    1. Build the project for web.
    2. Setup pubspec config as following
    sentry:
      upload_source_maps: true
    
    
    1. Run flutter flutter packages pub run sentry_dart_plugin

    Expected Result

    We were using sentry-cli to upload source map previously and it also didn't work. We were asked to try this new plugin and seem it also doesn't work.

    Screenshot 2022-08-29 at 3 41 22 PM

    Actual Result

    Source maps should setup correctly.

    question Platform: Dart 
    opened by ghost 19
  • "pub finished with exit code 1" (and no error message)

    We use sentry.io and the latest Flutter SDK. We're trying to get stack traces working on Android and it has been extremely difficult to get clarity on that process. We found this plugin and are still a bit confused how to use it.

    If we have autoUpload = true in our build.gradle do we still need to run flutter packages pub run sentry_dart_plugin after we build? The comment here - https://docs.sentry.io/platforms/android/proguard/ - makes it seem like we wouldn't but then this plugin's README says that this command flutter packages pub run sentry_dart_plugin is a replacement for the sentry-cli manual stuff, NOT that autoupload setting. It would be good to clarify.

    Also when running flutter packages pub run sentry_dart_plugin we get no error messages, just warnings, but we do get an exit code of 1 which idiomatically means error - "pub finished with exit code 1" ...so confused about that as well

    question 
    opened by tamoyal 17
  • beta.4">

    "You do not have permission to perform this action." after updating beta.2 => beta.4

    Environment

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 3.3.6, on Microsoft Windows [Version 10.0.22621.674], locale hr-HR)
    [!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        X cmdline-tools component is missing
          Run `path/to/sdkmanager --install "cmdline-tools;latest"`
          See https://developer.android.com/studio/command-line for more details.
        X Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
    [√] Chrome - develop for the web
    [X] Visual Studio - develop for Windows
        X Visual Studio not installed; this is necessary for Windows development.
          Download at https://visualstudio.microsoft.com/downloads/.
          Please install the "Desktop development with C++" workload, including all of its default components
    [√] Android Studio (version 2021.3)
    [√] VS Code (version 1.72.2)
    [√] Connected device (3 available)
    [√] HTTP Host Availability
    
    ! Doctor found issues in 2 categories.
    

    Steps to Reproduce

    After updating from beta.2 to beta.4:

    call flutter pub get
    call flutter pub run build_runner build --delete-conflicting-outputs
    call flutter build web --release --source-maps
    call flutter pub run sentry_dart_plugin
    

    pubspec.yaml (placeholders shown)

    sentry:
      upload_source_maps: true
      project: project_name
      org: org_name
      auth_token: auth_token
    

    Forcing beta.2 resolves the issue.

    Expected Result

    The logs usually upload just fine.

    Actual Result

    β˜‘ uploading source maps
    
    exitCode: 1
    stderr: error: API request failed
      caused by: sentry reported an error: You do not have permission to perform this action. (http status: 403)
    

    Thanks :)

    Platform: Dart waiting for feedback 
    opened by IvanDeluxe 12
  • [flutter android] error: build/web, No such file or directory (os error 2),this plugin don't support flutter android?

    [flutter android] error: build/web, No such file or directory (os error 2),this plugin don't support flutter android?

    Environment

    flutter: 3.0.4 sentry_dart_plugin: ^1.0.0-beta.2 What version are you running? Etc.

    Steps to Reproduce

    sentry: include_native_sources: true upload_source_maps: true

    1.flutter pub get 2.flutter build apk --obfuscate --split-debug-info=path --release 3.flutter packages pub run sentry_dart_plugin

    Expected Result

    I would expect the commands to succeed.

    Actual Result

    2022-09-16T11:50:34.6349449Z INFO [2022-09-16 11:50:34.63]: β–Έ stdout: Created release ***[email protected]. 2022-09-16T11:50:34.6431421Z INFO [2022-09-16 11:50:34.64]: β–Έ stderr: error: /home/runner/work/***_mobile/***_mobile/build/web: IO error for operation on /home/runner/work/***_mobile/***_mobile/build/web: No such file or directory (os error 2) 2022-09-16T11:50:34.6439116Z INFO [2022-09-16 11:50:34.64]: β–Έ Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output. 2022-09-16T11:50:34.6440223Z INFO [2022-09-16 11:50:34.64]: β–Έ Please attach the full debug log to all bug reports. 2022-09-16T11:50:34.6484457Z INFO [2022-09-16 11:50:34.64]: β–Έ stdout:

    question Platform: Dart 
    opened by lyf571321556 6
  • Support for setting commit

    Support for setting commit

    Release tracking gets even better with Commit Hash info when the GitHub source repo is integrated with Sentry.

    The sentry releases set-commits command would be useful if integrated

    help wanted Platform: Dart 
    opened by danilofuchs 6
  • Rename to sentry_plugin?

    Rename to sentry_plugin?

    Having dart in the name doesn't make that much sense on pub.dev - consider renaming to sentry_plugin (or is there a better name) before releasing the first version. Unfortunately, we can't rename a published package, the old one would need to be archived/deleted. Maybe the trouble is worth it 🀷

    Or maybe even move it to the main sentry_dart as an additional binary, so people don't have to add yet another dependency?

    Platform: Dart 
    opened by vaind 5
  • Debug Information Files

    Debug Information Files

    1. configure sentry_dart_plugin liberia
      • I have configured my pub with the examples

    I have sentry-cli installed

    USE:
    
        ..sentry-cli.exe [OPTIONS] <SUBCOMMAND>
    
    OPTIONS:
            --api-key <API_KEY> The provided Sentry API key.
            --auth-token <AUTH_TOKEN> Use the supplied Sentry authentication token.
        -h, --help Print help information
            --header <KEY:VALUE> Custom headers to be attached to all requests
                                         in key:value format.
            --log-level <LOG_LEVEL> Sets the verbosity level of log output. [possible values: trace, debug,
                                         information, warning, error]
            --quiet Do not print any output while keeping the correct exit code.
                                         This flag is currently implemented only for selected
                                         subcommands. [alias: silent]
            --url <URL> Full URL for the Sentry server.
                                         [default: https://sentry.io/]
        -V, --version Print version information
    

    and I get these errors, and I don't know how to fix it

    [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..
    sentry-cli is not available under the assets folder, using pre-installed sentry-cli
    β˜‘ reading config values
    [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 9% validating config values..
    sentry-cli is not available, please follow https://docs.sentry.io/product/cli/installation/
    ProcessException: El sistema no puede encontrar el archivo especificado.
    
    question Platform: Dart 
    opened by miguelflores1993 5
  • Changing `log_level` causes premature exit

    Changing `log_level` causes premature exit

    Environment

    Sentry SaaS with sentry_dart_plugin 1.0.0-beta.1.

    Steps to Reproduce

    1. Set log_level to debug in pubspec.yaml.
    sentry:
      auth_token: XXX
      log_level: debug # Uploading source maps will fail if this is lower than warn.
      org: my-org
      project: my-project
      upload_native_symbols: false
      upload_source_maps: true
    
    1. Run flutter packages pub run sentry_dart_plugin.

    Expected Result

    Source maps are uploaded.

    Actual Result

    After creating the release, the CLI exits prematurely because debug statements like this are written to STDERR:

    stdout: Created release [email protected]+1.
    
    
    stderr:   DEBUG   2022-03-23 22:59:35.150167 -07:00 sentry-cli version: 1.69.1, platform: "darwin", architecture: "x86_64"
      INFO    2022-03-23 22:59:35.150718 -07:00 sentry-cli was invoked with the following command line: "/Users/vsomayaji/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/sentry_dart_plugin-1.0.0-beta.1/lib/assets/sentry-cli-Darwin-x86_64" "--auth-token" "XXX" "--log-level" "trace" "releases" "--org" "my-org" "--project" "my-project" "new" "[email protected]+1"
      DEBUG   2022-03-23 22:59:35.150953 -07:00 request POST https://sentry.io/api/0/projects/my-org/my-project/releases/
      DEBUG   2022-03-23 22:59:35.150972 -07:00 using token authentication
    

    This appears to be because this code exits whenever STDERR is not empty:

    https://github.com/getsentry/sentry-dart-plugin/blob/347089e40c4271410e0bf78c5567a7fcd5430572/lib/src/utils/log.dart#L111-L113

    bug 
    opened by vsomayaji 5
  • Add `url` as configurable parameter

    Add `url` as configurable parameter

    :scroll: Description

    Added url as configurable parameter

    :bulb: Motivation and Context

    To use this plugin with on-premise Sentry servers

    :green_heart: How did you test it?

    With our own on-premise Sentry server!

    :pencil: Checklist

    • [x] I reviewed submitted code
    • [ ] I added tests to verify changes
    • [x] I updated the docs if needed
    • [ ] All tests passing
    • [x] No breaking changes
    opened by Amir-P 4
  • error: unsupported Zip archive

    error: unsupported Zip archive

    Environment

    flutter: 3.3.0 sentry_dart_plugin: ^1.0.0-beta.2

    This was run in a GitLab CI environment with the docker image cirrusci/flutter:stable. The CI logs report: Using docker image sha256:9353de5b90829520a303fcc804b7fa8ed5ad07422811492be8c32888f398268a for cirrusci/flutter:stable with digest cirrusci/flutter@sha256:850c03338df79146ab9990ee7acd24a168713bf442b695936f4a645d15467131

    GitLab version: 15.3.3 GitLab runner version: 15.1.0

    Steps to Reproduce

    sentry:
      upload_native_symbols: true
      upload_source_maps: true
      include_native_sources: true
      project: [redacted]
      org: [redacted]
      url: https://[redacted]/
      wait_for_processing: true
    
    1. flutter pub get
    2. flutter packages pub run sentry_dart_plugin

    Expected Result

    I would expect the commands to succeed.

    Actual Result

    ...stripped ~12 MB of other irrelevant logs...
    
      DEBUG   2022-09-07 12:24:20.935910615 +00:00 finished zip archive /builds/flutter/aio/.pub-cache/hosted/pub.dartlang.org/archive-3.3.0/test/tests/res/zip/test-trailing-junk.zip
      DEBUG   2022-09-07 12:24:20.935920090 +00:00 searching zip archive /builds/flutter/aio/.pub-cache/hosted/pub.dartlang.org/archive-3.3.0/test/tests/res/zip/password_zipcrypto.zip
    error: unsupported Zip archive
      DEBUG   2022-09-07 12:24:20.941438106 +00:00 client close; no transport to shut down  (from sentry)
      DEBUG   2022-09-07 12:24:20.941448845 +00:00 skipping update nagger because session is not attended
    stdout: 
    pub finished with exit code 1
    
    bug Effort: Small Impact: Small Platform: Dart sentry-cli 
    opened by davidpanic 3
  • feat: support release commits (and improve tests)

    feat: support release commits (and improve tests)

    :scroll: Description

    • refactor: speed up plugin tests by using mock CLI
    • test: refactor plugin_test
    • feat: support setting commits - closes #19
    • fix integration test server (wip)

    :bulb: Motivation and Context

    :green_heart: How did you test it?

    added unit tests and manually on a personal project

    :pencil: Checklist

    • [x] I reviewed submitted code
    • [x] I added tests to verify changes
    • [ ] I updated the docs if needed
    • [x] All tests passing
    • [x] No breaking changes

    :crystal_ball: Next steps

    opened by vaind 2
  • Flutter web source maps - file structure and files showing in chrome console

    Flutter web source maps - file structure and files showing in chrome console

    Platform:

    Flutter Web CanvasKit (Flutter Web) enabled

    Not exactly a bug but more of a data sensitivity issue. Sentry flutter web currently uploads the source maps e.g. below, and you can see every filename in our repo. Is there any way to prevent this from happening while ensuring errors can be traced in Sentry issues viewer?

    Chrome sources tab:

    image

    Existing config:

    sentry:
      upload_native_symbols: true
      upload_source_maps: true
      include_native_sources: true
      project: xxx
      org: yyy
      auth_token:
      wait_for_processing: false
      log_level: error
      commits: false
      web_build_path: build/web
      url: ~
    
    Platform: Dart 
    opened by kenNg1 0
  • Sentry Dart Plugin - GA - plan

    Sentry Dart Plugin - GA - plan

    opened by marandaneto 3
  • Support sentry.properties

    Support sentry.properties

    Right now the configuration is read thru the plugin configuration or via env. var. Sentry Wizard is able to generate a properties file, the plugin could read the conf. from this file as well.

    Effort: Small Impact: Medium Platform: Dart 
    opened by marandaneto 0
  • [Flutter Web] Unable to define SENTRY_AUTH_TOKEN via --dart-define

    [Flutter Web] Unable to define SENTRY_AUTH_TOKEN via --dart-define

    Environment

    Flutter Web

    How do you use Sentry? Sentry SaaS (sentry.io)

    Which SDK and version? Flutter 2.8.1, sentry_dart_plugin: ^1.0.0-beta.1

    Steps to Reproduce

    In pubspec.yaml:

    sentry:
      project: projectname
      org: orgname
    

    In terminal:

    flutter build web --dart-define SENTRY_AUTH_TOKEN=64CHARLONGSTR
    flutter pub run sentry_dart_plugin
    

    Expected Result

    I expected it to work :D

    Actual Result

    [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..
    sentry-cli is not available under the assets folder, using pre-installed sentry-cli
    β˜‘ reading config values
    [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 9% validating config values..
    Auth Token is empty, check 'auth_token' at pubspec.yaml or SENTRY_AUTH_TOKEN env. var.
    pub finished with exit code 1
    

    Did I do something wrong?

    Thanks!

    enhancement up-for-grabs Effort: Small Impact: Small Platform: Dart 
    opened by IvanDeluxe 10
Releases(1.0.0-beta.4)
Owner
Sentry
Real-time crash reporting for your web apps, mobile apps, and games.
Sentry
An E-Commerce application developed on Flutter, which helps to run the app on Android / IOS / Windows's OS / MacOS / Web Browser from a single codebase

BuySmart An E-Commerce application developed on Flutter, which helps to run the app on Android / IOS / Windows's OS / MacOS / Web Browser from a singl

Sumit Kumar 11 Oct 10, 2022
Responsive Blog Theme using Flutter | Web, macOS, Android, iOS

Responsive Blog Theme using Flutter | Web, macOS, Android, iOS Watch it on YouTube Packages we are using: flutter_svg: link get: link Flutter recently

Abu Anwar 196 Dec 9, 2022
Movies application (Cubit, Android, iOS, macOS, Web, Windows)

Movies App (Cubit) Movies Application Platforms 1 - Android 2 - iOS 3 - macOS 4 - Web 5 - Windows Libraries & Tools Flutter 3.0.1 β€’ channel stable Da

Alexandr Zherebtsov 1 Jun 7, 2022
Android Debug Drawer for faster development

Android Debug Drawer Faster development with Debug Drawer Features DeviceModule - common information about your device BuildModule - app build informa

Mantas Palaima 1.2k Nov 21, 2022
A Flutter plugin that provides assets abstraction management APIs without UI integration, you can get assets (image/video/audio) on Android, iOS and macOS.

photo_manager Photo/Assets management APIs for Flutter without UI integration, you can get assets (image/video/audio) from Android, iOS and macOS. 提供相

FlutterCandies 526 Jan 4, 2023
Flutter google maps - Flutter google maps Example

google_maps_example Development Setup Clone the repository and run the following

Isaac Pitwa Nyonyintono 12 Oct 23, 2022
πŸ’³ A Flutter package for making payments via credo central. Provides support for both Android and iOS

?? Credo Package for Flutter TODO: Put a short description of the package here that helps potential users know whether this package might be useful fo

Samuel Abada 0 Dec 26, 2021
:bug: Flutter debug helper widget with common and custom actions

Debug Friend Flutter debug helper widget with common and custom actions This helps you reduce the development and testing time of new features Show so

Stanislav Ilin 43 Dec 7, 2022
UIWidget is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.

⚠️ The main repository of UIWidgets has been moved to https://github.com/Unity-Technologies/com.unity.uiwidgets. Please visit the new site if you have

Unity Technologies 1.9k Dec 27, 2022
Write and debug tests easily, built on integration_test

flutter_convenient_test: Write and debug tests easily, built on integration_test Quick demo full_video.mov Have questions? Though used in production e

fzyzcjy 324 Dec 21, 2022
Adds a side menu in all screens with debug information

Adds a side menu in all screens with debug information. You can decide which information to show and create new modules to include more information.

Sergi MartΓ­nez 27 Oct 7, 2022
Build different UIs for Android, iOS, Web, Desktop, Wear, TV etc without the if/else checks in your widgets.

platform_widget_mixin Plugin to decouple widgets based on various platform properties. Features Build different UIs for Android, iOS, Web, Desktop, We

Rahul Kumar 6 Nov 17, 2022
Dart wrapper via `dart:js` for webusb

Dart wrapper via dart:js for https://wicg.github.io/webusb/ Features canUseUsb g

Woodemi Co., Ltd 1 Jan 25, 2022
Helper app to run code on Aliucord iOS via websocket.

aliucordebug A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Zoey 2 Jan 25, 2022
flutter web app with given code and example. Step by step teaching how to build a flutter web app with backend

flutter_web A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

dbestech 20 Oct 26, 2022
Native Drag and Drop for Flutter on iOS and MacOS

native_draggable A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package t

Rody Davis 59 Dec 4, 2022
A simple yet powerful Flutter plugin for showing Toast at Android, iOS and Web.

Flutter Toast A simple yet powerful Flutter plugin for showing Toast at Android and iOS. Features: Native Toast Pure Flutter Toaster Installation Add

Eyro Labs 5 Dec 13, 2021
A CLI tool and Dart package that can scrape file and directory URLs from h5ai instances.

h5ai scraper A CLI tool and Dart package that can scrape file and directory URLs from h5ai instances. Usage This tool requires the Dart SDK. It can be

null 1 Jan 4, 2023