diff --git a/docs/platforms/dart/configuration/environments.mdx b/docs/platforms/dart/common/configuration/environments.mdx similarity index 100% rename from docs/platforms/dart/configuration/environments.mdx rename to docs/platforms/dart/common/configuration/environments.mdx diff --git a/docs/platforms/dart/configuration/filtering.mdx b/docs/platforms/dart/common/configuration/filtering.mdx similarity index 100% rename from docs/platforms/dart/configuration/filtering.mdx rename to docs/platforms/dart/common/configuration/filtering.mdx diff --git a/docs/platforms/dart/configuration/index.mdx b/docs/platforms/dart/common/configuration/index.mdx similarity index 85% rename from docs/platforms/dart/configuration/index.mdx rename to docs/platforms/dart/common/configuration/index.mdx index cff67a5bf5f5c..6f4be034683e5 100644 --- a/docs/platforms/dart/configuration/index.mdx +++ b/docs/platforms/dart/common/configuration/index.mdx @@ -1,7 +1,7 @@ --- title: Configuration description: "Additional configuration options for the SDK." -sidebar_order: 5 +sidebar_order: 4 --- diff --git a/docs/platforms/dart/configuration/options.mdx b/docs/platforms/dart/common/configuration/options.mdx similarity index 100% rename from docs/platforms/dart/configuration/options.mdx rename to docs/platforms/dart/common/configuration/options.mdx diff --git a/docs/platforms/dart/configuration/releases.mdx b/docs/platforms/dart/common/configuration/releases.mdx similarity index 100% rename from docs/platforms/dart/configuration/releases.mdx rename to docs/platforms/dart/common/configuration/releases.mdx diff --git a/docs/platforms/dart/configuration/sampling.mdx b/docs/platforms/dart/common/configuration/sampling.mdx similarity index 100% rename from docs/platforms/dart/configuration/sampling.mdx rename to docs/platforms/dart/common/configuration/sampling.mdx diff --git a/docs/platforms/dart/data-management/data-collected.mdx b/docs/platforms/dart/common/data-management/data-collected.mdx similarity index 100% rename from docs/platforms/dart/data-management/data-collected.mdx rename to docs/platforms/dart/common/data-management/data-collected.mdx diff --git a/docs/platforms/dart/data-management/index.mdx b/docs/platforms/dart/common/data-management/index.mdx similarity index 100% rename from docs/platforms/dart/data-management/index.mdx rename to docs/platforms/dart/common/data-management/index.mdx diff --git a/docs/platforms/dart/data-management/sensitive-data/index.mdx b/docs/platforms/dart/common/data-management/sensitive-data/index.mdx similarity index 100% rename from docs/platforms/dart/data-management/sensitive-data/index.mdx rename to docs/platforms/dart/common/data-management/sensitive-data/index.mdx diff --git a/docs/platforms/dart/common/debug-symbols/dart-plugin.mdx b/docs/platforms/dart/common/debug-symbols/dart-plugin.mdx new file mode 100644 index 0000000000000..67335d13a51f7 --- /dev/null +++ b/docs/platforms/dart/common/debug-symbols/dart-plugin.mdx @@ -0,0 +1,9 @@ +--- +title: Sentry Dart Plugin +description: "Learn how to use the Sentry Dart Plugin to automatically upload debug symbols for your Dart application." +sidebar_order: 1 +--- + +The [Sentry Dart Plugin](https://github.com/getsentry/sentry-dart-plugin) is the recommended way to upload debug symbols for Dart applications. It automates the upload process for Android, iOS, macOS, and Web, making it seamless to provide Sentry with the necessary files for symbolication. + + \ No newline at end of file diff --git a/docs/platforms/dart/common/debug-symbols/index.mdx b/docs/platforms/dart/common/debug-symbols/index.mdx new file mode 100644 index 0000000000000..85864c4fa403b --- /dev/null +++ b/docs/platforms/dart/common/debug-symbols/index.mdx @@ -0,0 +1,35 @@ +--- +title: Debug Symbols +description: "Learn about uploading debug symbols to enable symbolication of stack traces in your Dart applications." +sidebar_order: 3 +--- + +Debug symbols are essential for understanding stack traces in your Dart application when errors occur. Without debug symbols, stack traces from minified or obfuscated code can be difficult or impossible to interpret. + + + +Sentry currently doesn't support uploading debug symbols for pure Dart applications. Please see the [Flutter debug symbols documentation](/platforms/dart/guides/flutter/debug-symbols/) for Flutter applications. This feature is being tracked in our GitHub Issue: [sentry-dart/#1508](https://github.com/getsentry/sentry-dart/issues/1508). + + + +## What Are Debug Symbols? + +Debug symbols provide the necessary information to convert program addresses back to function names, source file names, and line numbers. When you build a Dart application, especially with obfuscation or optimization enabled, this information is typically removed from the main application bundle to reduce size. + +## When to Upload Debug Symbols + +With default settings, complete stack traces are available in your Dart errors out of the box, unless you use [`split-debug-info`](https://flutter.dev/docs/perf/app-size#reducing-app-size) and [`obfuscate`](https://flutter.dev/docs/deployment/obfuscate) flags. In these cases, you must upload the debug information files generated by the build, so Sentry can show proper stack traces. + +## Upload Methods + +Sentry offers several methods to upload debug symbols for Dart applications: + +1. **[Sentry Dart Plugin (Recommended)](/platforms/dart/debug-symbols/dart-plugin)** - The easiest way to automatically upload debug symbols for iOS, Android, Desktop and Web. + +2. **[Manual Upload Options](/platforms/dart/debug-symbols/manual-upload):** + - [iOS and macOS](/platforms/apple/dsym/) - Upload dSYM files for symbolication of Apple platform crashes. + - [Android](/cli/dif/#uploading-files) - Upload mapping files manually using the Sentry CLI. + - [Android NDK](/cli/dif/#uploading-files) - Upload ELF DWARF debug files for native code crashes. + - [Web](/cli/releases/#upload-source-maps) - Upload source maps for Flutter web applications. + +Choose the method that best suits your workflow and platform requirements. For most users, the Sentry Dart Plugin provides the simplest solution across all platforms. \ No newline at end of file diff --git a/docs/platforms/dart/common/debug-symbols/manual-upload.mdx b/docs/platforms/dart/common/debug-symbols/manual-upload.mdx new file mode 100644 index 0000000000000..4bce55f591d5c --- /dev/null +++ b/docs/platforms/dart/common/debug-symbols/manual-upload.mdx @@ -0,0 +1,9 @@ +--- +title: Manual Upload +description: "Learn how to manually upload debug symbols for your Dart applications." +sidebar_order: 2 +--- + +If you choose not to use the Sentry Dart Plugin, you can manually upload debug symbols for your Dart applications. This page provides instructions for different platforms. + + \ No newline at end of file diff --git a/docs/platforms/dart/enriching-events/attachments/index.mdx b/docs/platforms/dart/common/enriching-events/attachments/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/attachments/index.mdx rename to docs/platforms/dart/common/enriching-events/attachments/index.mdx diff --git a/docs/platforms/dart/enriching-events/breadcrumbs/index.mdx b/docs/platforms/dart/common/enriching-events/breadcrumbs/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/breadcrumbs/index.mdx rename to docs/platforms/dart/common/enriching-events/breadcrumbs/index.mdx diff --git a/docs/platforms/dart/enriching-events/context/index.mdx b/docs/platforms/dart/common/enriching-events/context/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/context/index.mdx rename to docs/platforms/dart/common/enriching-events/context/index.mdx diff --git a/docs/platforms/dart/enriching-events/identify-user/index.mdx b/docs/platforms/dart/common/enriching-events/identify-user/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/identify-user/index.mdx rename to docs/platforms/dart/common/enriching-events/identify-user/index.mdx diff --git a/docs/platforms/dart/enriching-events/index.mdx b/docs/platforms/dart/common/enriching-events/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/index.mdx rename to docs/platforms/dart/common/enriching-events/index.mdx diff --git a/docs/platforms/dart/enriching-events/scopes/index.mdx b/docs/platforms/dart/common/enriching-events/scopes/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/scopes/index.mdx rename to docs/platforms/dart/common/enriching-events/scopes/index.mdx diff --git a/docs/platforms/dart/enriching-events/tags/index.mdx b/docs/platforms/dart/common/enriching-events/tags/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/tags/index.mdx rename to docs/platforms/dart/common/enriching-events/tags/index.mdx diff --git a/docs/platforms/dart/enriching-events/transaction-name/index.mdx b/docs/platforms/dart/common/enriching-events/transaction-name/index.mdx similarity index 100% rename from docs/platforms/dart/enriching-events/transaction-name/index.mdx rename to docs/platforms/dart/common/enriching-events/transaction-name/index.mdx diff --git a/docs/platforms/dart/features/index.mdx b/docs/platforms/dart/common/features/index.mdx similarity index 100% rename from docs/platforms/dart/features/index.mdx rename to docs/platforms/dart/common/features/index.mdx diff --git a/docs/platforms/dart/index.mdx b/docs/platforms/dart/common/index.mdx similarity index 100% rename from docs/platforms/dart/index.mdx rename to docs/platforms/dart/common/index.mdx diff --git a/docs/platforms/dart/integrations/dio.mdx b/docs/platforms/dart/common/integrations/dio.mdx similarity index 100% rename from docs/platforms/dart/integrations/dio.mdx rename to docs/platforms/dart/common/integrations/dio.mdx diff --git a/docs/platforms/dart/integrations/file.mdx b/docs/platforms/dart/common/integrations/file.mdx similarity index 100% rename from docs/platforms/dart/integrations/file.mdx rename to docs/platforms/dart/common/integrations/file.mdx diff --git a/docs/platforms/dart/integrations/http-integration.mdx b/docs/platforms/dart/common/integrations/http-integration.mdx similarity index 100% rename from docs/platforms/dart/integrations/http-integration.mdx rename to docs/platforms/dart/common/integrations/http-integration.mdx diff --git a/docs/platforms/dart/integrations/index.mdx b/docs/platforms/dart/common/integrations/index.mdx similarity index 100% rename from docs/platforms/dart/integrations/index.mdx rename to docs/platforms/dart/common/integrations/index.mdx diff --git a/docs/platforms/dart/integrations/logging.mdx b/docs/platforms/dart/common/integrations/logging.mdx similarity index 100% rename from docs/platforms/dart/integrations/logging.mdx rename to docs/platforms/dart/common/integrations/logging.mdx diff --git a/docs/platforms/dart/metrics/index.mdx b/docs/platforms/dart/common/metrics/index.mdx similarity index 100% rename from docs/platforms/dart/metrics/index.mdx rename to docs/platforms/dart/common/metrics/index.mdx diff --git a/docs/platforms/dart/migration/index.mdx b/docs/platforms/dart/common/migration/index.mdx similarity index 100% rename from docs/platforms/dart/migration/index.mdx rename to docs/platforms/dart/common/migration/index.mdx diff --git a/docs/platforms/dart/overhead/index.mdx b/docs/platforms/dart/common/overhead/index.mdx similarity index 100% rename from docs/platforms/dart/overhead/index.mdx rename to docs/platforms/dart/common/overhead/index.mdx diff --git a/docs/platforms/dart/tracing/index.mdx b/docs/platforms/dart/common/tracing/index.mdx similarity index 100% rename from docs/platforms/dart/tracing/index.mdx rename to docs/platforms/dart/common/tracing/index.mdx diff --git a/docs/platforms/dart/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/dart/common/tracing/instrumentation/automatic-instrumentation.mdx similarity index 100% rename from docs/platforms/dart/tracing/instrumentation/automatic-instrumentation.mdx rename to docs/platforms/dart/common/tracing/instrumentation/automatic-instrumentation.mdx diff --git a/docs/platforms/dart/tracing/instrumentation/custom-instrumentation.mdx b/docs/platforms/dart/common/tracing/instrumentation/custom-instrumentation.mdx similarity index 100% rename from docs/platforms/dart/tracing/instrumentation/custom-instrumentation.mdx rename to docs/platforms/dart/common/tracing/instrumentation/custom-instrumentation.mdx diff --git a/docs/platforms/dart/tracing/instrumentation/index.mdx b/docs/platforms/dart/common/tracing/instrumentation/index.mdx similarity index 100% rename from docs/platforms/dart/tracing/instrumentation/index.mdx rename to docs/platforms/dart/common/tracing/instrumentation/index.mdx diff --git a/docs/platforms/dart/tracing/instrumentation/performance-metrics.mdx b/docs/platforms/dart/common/tracing/instrumentation/performance-metrics.mdx similarity index 100% rename from docs/platforms/dart/tracing/instrumentation/performance-metrics.mdx rename to docs/platforms/dart/common/tracing/instrumentation/performance-metrics.mdx diff --git a/docs/platforms/dart/tracing/trace-propagation/custom-instrumentation/index.mdx b/docs/platforms/dart/common/tracing/trace-propagation/custom-instrumentation/index.mdx similarity index 100% rename from docs/platforms/dart/tracing/trace-propagation/custom-instrumentation/index.mdx rename to docs/platforms/dart/common/tracing/trace-propagation/custom-instrumentation/index.mdx diff --git a/docs/platforms/dart/tracing/trace-propagation/dealing-with-cors-issues/index.mdx b/docs/platforms/dart/common/tracing/trace-propagation/dealing-with-cors-issues/index.mdx similarity index 100% rename from docs/platforms/dart/tracing/trace-propagation/dealing-with-cors-issues/index.mdx rename to docs/platforms/dart/common/tracing/trace-propagation/dealing-with-cors-issues/index.mdx diff --git a/docs/platforms/dart/tracing/trace-propagation/index.mdx b/docs/platforms/dart/common/tracing/trace-propagation/index.mdx similarity index 100% rename from docs/platforms/dart/tracing/trace-propagation/index.mdx rename to docs/platforms/dart/common/tracing/trace-propagation/index.mdx diff --git a/docs/platforms/dart/usage/index.mdx b/docs/platforms/dart/common/usage/index.mdx similarity index 100% rename from docs/platforms/dart/usage/index.mdx rename to docs/platforms/dart/common/usage/index.mdx diff --git a/docs/platforms/dart/usage/sdk-fingerprinting/index.mdx b/docs/platforms/dart/common/usage/sdk-fingerprinting/index.mdx similarity index 100% rename from docs/platforms/dart/usage/sdk-fingerprinting/index.mdx rename to docs/platforms/dart/common/usage/sdk-fingerprinting/index.mdx diff --git a/docs/platforms/dart/usage/set-level/index.mdx b/docs/platforms/dart/common/usage/set-level/index.mdx similarity index 100% rename from docs/platforms/dart/usage/set-level/index.mdx rename to docs/platforms/dart/common/usage/set-level/index.mdx diff --git a/docs/platforms/dart/user-feedback/index.mdx b/docs/platforms/dart/common/user-feedback/index.mdx similarity index 100% rename from docs/platforms/dart/user-feedback/index.mdx rename to docs/platforms/dart/common/user-feedback/index.mdx diff --git a/docs/platforms/dart/config.yml b/docs/platforms/dart/config.yml new file mode 100644 index 0000000000000..ce72aa46c46bd --- /dev/null +++ b/docs/platforms/dart/config.yml @@ -0,0 +1,11 @@ +title: Dart +caseStyle: camelCase +supportLevel: production +sdk: sentry.dart +categories: + - desktop + - mobile + - server +keywords: + - flutter + - dart \ No newline at end of file diff --git a/docs/platforms/dart/guides/flutter/debug-symbols/dart-plugin.mdx b/docs/platforms/dart/guides/flutter/debug-symbols/dart-plugin.mdx new file mode 100644 index 0000000000000..67335d13a51f7 --- /dev/null +++ b/docs/platforms/dart/guides/flutter/debug-symbols/dart-plugin.mdx @@ -0,0 +1,9 @@ +--- +title: Sentry Dart Plugin +description: "Learn how to use the Sentry Dart Plugin to automatically upload debug symbols for your Dart application." +sidebar_order: 1 +--- + +The [Sentry Dart Plugin](https://github.com/getsentry/sentry-dart-plugin) is the recommended way to upload debug symbols for Dart applications. It automates the upload process for Android, iOS, macOS, and Web, making it seamless to provide Sentry with the necessary files for symbolication. + + \ No newline at end of file diff --git a/docs/platforms/dart/guides/flutter/debug-symbols/index.mdx b/docs/platforms/dart/guides/flutter/debug-symbols/index.mdx new file mode 100644 index 0000000000000..4d46a7adf08c5 --- /dev/null +++ b/docs/platforms/dart/guides/flutter/debug-symbols/index.mdx @@ -0,0 +1,29 @@ +--- +title: Debug Symbols +description: "Learn about uploading debug symbols to enable symbolication of stack traces in your Dart applications." +sidebar_order: 3 +--- + +Debug symbols are essential for understanding stack traces in your Dart application when errors occur. Without debug symbols, stack traces from minified or obfuscated code can be difficult or impossible to interpret. + +## What Are Debug Symbols? + +Debug symbols provide the necessary information to convert program addresses back to function names, source file names, and line numbers. When you build a Dart application, especially with obfuscation or optimization enabled, this information is typically removed from the main application bundle to reduce size. + +## When to Upload Debug Symbols + +With default settings, complete stack traces are available in your Dart errors out of the box, unless you use [`split-debug-info`](https://flutter.dev/docs/perf/app-size#reducing-app-size) and [`obfuscate`](https://flutter.dev/docs/deployment/obfuscate) flags. In these cases, you must upload the debug information files generated by the build, so Sentry can show proper stack traces. + +## Upload Methods + +Sentry offers several methods to upload debug symbols for Dart applications: + +1. **[Sentry Dart Plugin (Recommended)](/platforms/dart/guides/flutter/debug-symbols/dart-plugin)** - The easiest way to automatically upload debug symbols for iOS, Android, and Web. + +2. **[Manual Upload Options](/platforms/dart/guides/flutter/debug-symbols/manual-upload):** + - [iOS and macOS](/platforms/apple/dsym/) - Upload dSYM files for symbolication of Apple platform crashes. + - [Android](/cli/dif/#uploading-files) - Upload mapping files manually using the Sentry CLI. + - [Android NDK](/cli/dif/#uploading-files) - Upload ELF DWARF debug files for native code crashes. + - [Web](/cli/releases/#upload-source-maps) - Upload source maps for Flutter web applications. + +Choose the method that best suits your workflow and platform requirements. For most users, the Sentry Dart Plugin provides the simplest solution across all platforms. \ No newline at end of file diff --git a/docs/platforms/dart/guides/flutter/debug-symbols/manual-upload.mdx b/docs/platforms/dart/guides/flutter/debug-symbols/manual-upload.mdx new file mode 100644 index 0000000000000..4bce55f591d5c --- /dev/null +++ b/docs/platforms/dart/guides/flutter/debug-symbols/manual-upload.mdx @@ -0,0 +1,9 @@ +--- +title: Manual Upload +description: "Learn how to manually upload debug symbols for your Dart applications." +sidebar_order: 2 +--- + +If you choose not to use the Sentry Dart Plugin, you can manually upload debug symbols for your Dart applications. This page provides instructions for different platforms. + + \ No newline at end of file diff --git a/docs/platforms/dart/guides/flutter/upload-debug.mdx b/docs/platforms/dart/guides/flutter/upload-debug.mdx deleted file mode 100644 index f11d45b88249e..0000000000000 --- a/docs/platforms/dart/guides/flutter/upload-debug.mdx +++ /dev/null @@ -1,254 +0,0 @@ ---- -title: Debug Symbols -description: "Learn more about uploading debug symbols for Android, iOS/macOS, and Flutter Web." -sidebar_order: 2 ---- - -We offer a range of methods to provide Sentry with debug symbols so that you can see symbolicated stack traces and triage issues faster. - -## When to Upload - -With default settings, complete stack traces are available in your Dart error, out of the box, unless you use [`split-debug-info`](https://flutter.dev/docs/perf/app-size#reducing-app-size) and [`obfuscate`](https://flutter.dev/docs/deployment/obfuscate). In those cases, you need to upload the debug information files generated by the `flutter` build, so Sentry can show you proper stack traces. - - - -For Flutter Desktop (Windows/Linux) `split-debug-info` and `obfuscate` flags are not supported yet. See this [issue](https://github.com/getsentry/sentry-dart/issues/433). - - - -Errors raised from the native layer in Flutter apps require certain debug information files to be uploaded. For example, an Android app can use `proguard` for minification and obfuscation. And when using NDK, dwarf debug files need to be uploaded. Flutter Web requires sourcemaps and iOS apps also require dwarf debug information files. - -## Sentry Dart Plugin - -The easiest way to upload debug symbols, source maps, and use source context is to use the [Sentry Dart Plugin](https://github.com/getsentry/sentry-dart-plugin) which will upload them automatically. - -### 1. Install - -In your `pubspec.yaml`, add `sentry_dart_plugin` as a new dev dependency. - -```yaml {filename: pubspec.yaml} -dev_dependencies: - sentry_dart_plugin: ^{{@inject packages.version('sentry.dart.plugin', '2.0.0') }} -``` - -### 2. Configure - -The Sentry Dart Plugin comes with a default configuration but requires you to set the `project`, `org`, and `auth_token` fields to use it. - -Add the following to your `pubspec.yaml` file: - -```yaml {filename: pubspec.yaml} -sentry: - project: ___PROJECT_SLUG___ - org: ___ORG_SLUG___ - auth_token: ___ORG_AUTH_TOKEN___ -``` - - - -The option `upload_debug_symbols` is enabled by default. That means the plugin will automatically upload debug symbols for all platforms except Flutter Web. - - - -#### Source Maps - -By default, source maps are not uploaded. In order to upload source maps, you need to set the `upload_source_maps` field to `true`. - -```yaml {filename: pubspec.yaml} {5} -sentry: - project: ___PROJECT_SLUG___ - org: ___ORG_SLUG___ - auth_token: ___ORG_AUTH_TOKEN___ - upload_source_maps: true -``` - -#### Source Context - -By default, sources are not uploaded. In order to upload sources, you need to set the `upload_sources` field to `true`. - -```yaml {filename: pubspec.yaml} {5} -sentry: - project: ___PROJECT_SLUG___ - org: ___ORG_SLUG___ - auth_token: ___ORG_AUTH_TOKEN___ - upload_sources: true - -``` - - - -This uploads the source files of the Dart/Flutter code, not the native code. -If you want to use source context for native code, you need to setup source context in the respective native platform. - - - -In addition to configuring the plugin in the `pubspec.yaml` file, the plugin supports using a properties file or environment variables. -For more information, read the [Sentry Dart Plugin README](https://github.com/getsentry/sentry-dart-plugin/tree/main?tab=readme-ov-file#configuration-optional). - -### 3. Build - -Run one of the following commands before executing the `sentry_dart_plugin` plugin. -If you choose to obfuscate your build, include the `--obfuscate` flag along with the `--split-debug-info` option to specify the directory for storing debug information. - -For a standard build: -- `flutter build apk` -- `flutter build ios` -- `flutter build macos` - -For an obfuscated build: -- `flutter build apk --obfuscate --split-debug-info=` -- `flutter build ios --obfuscate --split-debug-info=` -- `flutter build macos --obfuscate --split-debug-info=` - - - -For Flutter web run `flutter build web --release --source-maps` to generate source maps. - - - -### 4. Run - -Now we can run the plugin to upload the debug symbols, source maps, and sources (if enabled). - -```bash -flutter packages pub run sentry_dart_plugin -``` - - - -If you choose not to obfuscate your build, the plugin will not upload debug symbols but will still configure source context if enabled. - - - -### Proguard - -If you have ProGuard (`minifyEnabled`) enabled, you must upload the [Android Proguard/R8 mapping files](/platforms/android/enhance-errors/proguard) to see complete stack traces. - -In order to upload debug symbols for ProGuard obfuscated native Android code you have two options: -1. Use the [Sentry Android Gradle Plugin](/platforms/android/configuration/gradle/) -2. Use the [Sentry CLI](/cli/dif/#uploading-files) - -The Sentry Android Gradle Plugin is the simpler and recommended way to upload debug symbols for Android. - -After installing the Sentry Android Gradle Plugin, you need to set `autoInstallation` to `false` in your `app/build.gradle` file: - -```groovy {filename: app/build.gradle} -sentry { - autoInstallation { - enabled = false - } -} -``` - -Sentry Flutter already ships with a compatible Sentry Android SDK, so we need to disable the auto-installation which could cause conflicts with the packaged Sentry Android SDK. - -After setting up the gradle plugin, follow the [Android Gradle Plugin guide](/platforms/android/configuration/gradle/#proguardr8--dexguard) on how to upload Proguard mapping files. - -## Manually Upload Debug Symbols - -If you have an obfuscated build and you decide not to use the Sentry Dart Plugin, you can manually upload debug symbols for Android, iOS/macOS, Flutter Web. - -You will need to upload the following files: -- [dSYM files](/platforms/android/data-management/debug-files/file-formats/#mach-o-and-dsym) (`*.dSYM`) for iOS and macOS -- [Flutter generated symbols](https://docs.flutter.dev/deployment/obfuscate#obfuscate-your-app) (`*.symbols`) for Android and [ELF](/platforms/android/data-management/debug-files/file-formats/#executable-and-linkable-format-elf) for Android NDK -- Source Maps (`*.map`) for Web - -### iOS and macOS - -Sentry requires a dSYM upload to symbolicate your crash logs. The symbolication process unscrambles Apple’s crash logs to reveal the function, file names, and line numbers of the crash. [Learn how to upload the dSYM files](/platforms/apple/dsym/). - -### Android - -See our docs on uploading [Debug Information Files](/cli/dif/#uploading-files) manually with the Sentry CLI. - -### Android NDK - -See our docs on uploading [Debug Information Files](/cli/dif/#uploading-files) manually with the Sentry CLI. - -If you're using a version of `sentry_flutter` earlier than 5.1, native symbolication on Android requires a specific configuration. Refer to [Troubleshooting](/platforms/dart/guides/flutter/troubleshooting/#native-symbolication-on-android) for more information. - - - -Sentry's Flutter SDK doesn't currently support the `uploadNativeSymbols` flag from the [Sentry Gradle Plugin](/platforms/android/configuration/gradle/). - - - -### Web - -See our docs on uploading [Source Maps](/cli/releases/#upload-source-maps) manually. - -## Configuration Fields - -`project` - -The project's name, for example `sentry-flutter`. Required. This is a `string` type. The alternative environmental variable is `SENTRY_PROJECT`. - -`org` - -Your organization's slug, for example `sentry-sdks`. Required. This is a `string` type. The alternative environmental variable is `SENTRY_ORG`. - -`auth_token` - -The Sentry auth token, which will look like `<64 random characters>`. Required. This is a `string` type. The alternative environmental variable is `SENTRY_AUTH_TOKEN`. - -`upload_debug_symbols` - -Enables or disables the automatic upload of debug symbols. This is a boolean type with default value `true`. - -`upload_source_maps` - -Enables or disables the automatic upload of source maps. This is a boolean type with default value `false`. - -`upload_sources` - -Does or doesn't include the source code of native code. This is a boolean type with default value `false`. - -`url` - -The URL of your project, for example `https://mysentry.invalid/`. This is a `string` type. The alternative environmental variable is `SENTRY_URL`. - -`wait_for_processing` - -Wait for server-side processing of uploaded files. This is a boolean type with default value `false`. - -`log_level` - -Configures the log level for sentry-cli. This is a `string` type with default value `warn`. The alternative environmental variable is `SENTRY_LOG_LEVEL`. Possible values are `trace`, `debug`, `info`, `warn`, and `error`. - -`release` - -The release version for source maps, which should match the release set by the SDK. This is a `string` type with default value `name@version` from pubspec. If a build number is included in the version, it is utilized as dist. The alternative environmental variable is `SENTRY_RELEASE`. - -Setting a custom release can be specified via an environment variable or plugin configuration. Once set, it is used as is without further modification. - -`dist` - -Custom dist can also be set via the environment variable `SENTRY_DIST` or via plugin configuration. It replaces or adds to the build number in the default release. - -`web_build_path` - -The web build folder. This is a `string` type with default value `build/web`. - -`commits` - -Release commits integration. This is a `string` type with default value `auto`. - -`ignore_missing` - -Ignore missing commits previously used in the release. This is a boolean type with default value `false`. - -`bin_dir` - -The folder where the plugin downloads the sentry-cli binary. This is a `string` type with default value `.dart_tool/pub/bin/sentry_dart_plugin`. - -`bin_path` - -Path to the sentry-cli binary to use instead of downloading. Make sure to use the correct version. This is a `string` type and is empty by default. - -`sentry_cli_cdn_url` - -Alternative place to download sentry-cli. This is a `string` type with default value `https://downloads.sentry-cdn.com/sentry-cli`. Alternatively, this can also be set with the `SENTRYCLI_CDNURL` environment variable. - -## Troubleshooting - -Refer to [Troubleshooting - Sentry Dart Plugin](/platforms/dart/guides/flutter/troubleshooting#sentry-dart-plugin) to resolve potential issues. diff --git a/platform-includes/debug-symbols/dart-plugin/dart.mdx b/platform-includes/debug-symbols/dart-plugin/dart.mdx new file mode 100644 index 0000000000000..8c808348ecb6f --- /dev/null +++ b/platform-includes/debug-symbols/dart-plugin/dart.mdx @@ -0,0 +1,140 @@ +## Installation + +In your `pubspec.yaml`, add `sentry_dart_plugin` as a new dev dependency: + +```yaml {filename: pubspec.yaml} +dev_dependencies: + sentry_dart_plugin: ^{{@inject packages.version('sentry.dart.plugin', '2.0.0') }} +``` + +## Configuration + +The Sentry Dart Plugin requires basic configuration in your `pubspec.yaml` file: + + + +```yaml {filename:pubspec.yaml} {"onboardingOptions": {"source-context": "7-8", "source-maps": "9-10"}} +sentry: + project: ___PROJECT_SLUG___ + org: ___ORG_SLUG___ + auth_token: ___ORG_AUTH_TOKEN___ + # Disable automatic upload of debug symbols + # upload_debug_symbols: false + # Enable source context + upload_source_context: true + # Enable source maps + upload_source_maps: true +``` + + +The `upload_debug_symbols` option defaults to `true` when not specified. + + +### Alternative Configuration Methods + +In addition to configuring the plugin in `pubspec.yaml`, you can use: +- Environment variables +- Properties file + +For more information, read the [Sentry Dart Plugin README](https://github.com/getsentry/sentry-dart-plugin/tree/main?tab=readme-ov-file#configuration-optional). + +## Building Your Application + +Before running the plugin, build your Flutter application with one of the following commands. Obfuscated is encouraged for production builds, and will make uploading debug symbols necessary to get readable stack traces. + +```bash {tabTitle: Obfuscated} +flutter build apk --obfuscate --split-debug-info= +flutter build ios --obfuscate --split-debug-info= +flutter build macos --obfuscate --split-debug-info= +flutter build windows --obfuscate --split-debug-info= +flutter build linux --obfuscate --split-debug-info= +``` + +```bash {tabTitle: Flutter Web} +flutter build web --release --source-maps +``` + +For Flutter web run `flutter build web --release --source-maps` to generate source maps. + + +## Running the Plugin + +After building your application, run the plugin to upload debug symbols: + +```bash +flutter pub run sentry_dart_plugin +``` + + + +If you don't obfuscate your build, the plugin won't upload debug symbols. Additionally, source context (viewing source code in stack trace frames on Sentry) is not currently supported for non-obfuscated builds. GitHub Issue: [sentry-dart/#1314](https://github.com/getsentry/sentry-dart/issues/1314) + + + +## Android ProGuard Integration + +If you have ProGuard (`minifyEnabled`) enabled and you want to see proper native Android stacktraces, you must upload Android Proguard/R8 mapping files. You have two options: + +1. **Use the Sentry Android Gradle Plugin (Recommended)** + + After installing the [Sentry Android Gradle Plugin](/platforms/android/configuration/gradle/), set `autoInstallation` to `false` in your `app/build.gradle` file: + + ```groovy {filename: app/build.gradle} + sentry { + autoInstallation { + enabled = false + } + } + ``` + + This is necessary because Sentry Flutter already ships with a compatible Sentry Android SDK, so we need to avoid conflicts. + + Follow the [Android Gradle Plugin guide](/platforms/android/configuration/gradle/#proguardr8--dexguard) to complete the ProGuard mapping setup. + +2. **Use the Sentry CLI** + + Alternatively, you can use the [Sentry CLI](/cli/dif/#uploading-files) to manually upload mapping files. + + + +Sentry's Flutter SDK doesn't currently support the `uploadNativeSymbols` flag from the Sentry Gradle Plugin. + + + +## Configuration Reference + +The following table lists all available configuration options for the Sentry Dart Plugin: + +
+ +| Option | Type | Default | Description | Environment Variable | +|--------|------|---------|-------------|---------------------| +| `project` | string | | **Required.** Your project's name (e.g., `sentry-flutter`) | `SENTRY_PROJECT` | +| `org` | string | | **Required.** Your organization's slug (e.g., `sentry-sdks`) | `SENTRY_ORG` | +| `auth_token` | string | | **Required.** The Sentry auth token | `SENTRY_AUTH_TOKEN` | +| `upload_debug_symbols` | boolean | `true` | Enables or disables automatic upload of debug symbols | | +| `upload_source_maps` | boolean | `false` | Enables or disables automatic upload of source maps | | +| `upload_sources` | boolean | `false` | Enables or disables source code upload | | +| `url` | string | | The URL of your Sentry instance | `SENTRY_URL` | +| `wait_for_processing` | boolean | `false` | Whether to wait for server-side processing of uploaded files | | +| `log_level` | string | `warn` | Configures the log level for sentry-cli (`trace`, `debug`, `info`, `warn`, `error`) | `SENTRY_LOG_LEVEL` | +| `release` | string | `name@version` from pubspec | The release version for source maps | `SENTRY_RELEASE` | +| `dist` | string | | Custom distribution identifier | `SENTRY_DIST` | +| `web_build_path` | string | `build/web` | The web build folder path | | +| `commits` | string | `auto` | Release commits integration | | +| `ignore_missing` | boolean | `false` | Ignore missing commits previously used in the release | | +| `bin_dir` | string | `.dart_tool/pub/bin/sentry_dart_plugin` | The folder where the plugin downloads the sentry-cli binary | | +| `bin_path` | string | | Path to a sentry-cli binary to use instead of downloading | | +| `sentry_cli_cdn_url` | string | `https://downloads.sentry-cdn.com/sentry-cli` | Alternative place to download sentry-cli | `SENTRYCLI_CDNURL` | + +
+ +## Troubleshooting + +If you encounter any issues with the Sentry Dart Plugin, refer to [Troubleshooting - Sentry Dart Plugin](/platforms/dart/guides/flutter/troubleshooting#sentry-dart-plugin) for solutions to common problems. diff --git a/platform-includes/debug-symbols/dart-plugin/flutter.mdx b/platform-includes/debug-symbols/dart-plugin/flutter.mdx new file mode 100644 index 0000000000000..1975c9758a986 --- /dev/null +++ b/platform-includes/debug-symbols/dart-plugin/flutter.mdx @@ -0,0 +1,140 @@ +## Installation + +In your `pubspec.yaml`, add `sentry_dart_plugin` as a new dev dependency: + +```yaml {filename: pubspec.yaml} +dev_dependencies: + sentry_dart_plugin: ^{{@inject packages.version('sentry.dart.plugin', '2.0.0') }} +``` + +## Configuration + +The Sentry Dart Plugin requires basic configuration in your `pubspec.yaml` file: + + + +```yaml {filename:pubspec.yaml} {"onboardingOptions": {"source-context": "7-8", "source-maps": "9-10"}} +sentry: + project: ___PROJECT_SLUG___ + org: ___ORG_SLUG___ + auth_token: ___ORG_AUTH_TOKEN___ + # Disable automatic upload of debug symbols + # upload_debug_symbols: false + # Enable source context + upload_source_context: true + # Enable source maps + upload_source_maps: true +``` + + +The `upload_debug_symbols` option defaults to `true` when not specified. + + +### Alternative Configuration Methods + +In addition to configuring the plugin in `pubspec.yaml`, you can use: +- Environment variables +- Properties file + +For more information, read the [Sentry Dart Plugin README](https://github.com/getsentry/sentry-dart-plugin/tree/main?tab=readme-ov-file#configuration-optional). + +## Building Your Application + +Before running the plugin, build your Flutter application with one of the following commands. Obfuscated is encouraged for production builds, and will make uploading debug symbols necessary to get readable stack traces. + +```bash {tabTitle: Obfuscated} +flutter build apk --obfuscate --split-debug-info= +flutter build ios --obfuscate --split-debug-info= +flutter build macos --obfuscate --split-debug-info= +flutter build windows --obfuscate --split-debug-info= +flutter build linux --obfuscate --split-debug-info= +``` + +```bash {tabTitle: Flutter Web} +flutter build web --release --source-maps +``` + +For Flutter web run `flutter build web --release --source-maps` to generate source maps. + + +## Running the Plugin + +After building your application, run the plugin to upload debug symbols: + +```bash +flutter pub run sentry_dart_plugin +``` + + + +If you don't obfuscate your build, the plugin won't upload debug symbols. Additionally, source context (viewing source code in stack trace frames on Sentry) is not currently supported for non-obfuscated builds. GitHub Issue: [sentry-dart/#1314](https://github.com/getsentry/sentry-dart/issues/1314) + + + +## Android ProGuard Integration + +If you have ProGuard (`minifyEnabled`) enabled, you must upload Android Proguard/R8 mapping files. You have two options: + +1. **Use the Sentry Android Gradle Plugin (Recommended)** + + After installing the [Sentry Android Gradle Plugin](/platforms/android/configuration/gradle/), set `autoInstallation` to `false` in your `app/build.gradle` file: + + ```groovy {filename: app/build.gradle} + sentry { + autoInstallation { + enabled = false + } + } + ``` + + This is necessary because Sentry Flutter already ships with a compatible Sentry Android SDK, so we need to avoid conflicts. + + Follow the [Android Gradle Plugin guide](/platforms/android/configuration/gradle/#proguardr8--dexguard) to complete the ProGuard mapping setup. + +2. **Use the Sentry CLI** + + Alternatively, you can use the [Sentry CLI](/cli/dif/#uploading-files) to manually upload mapping files. + + + +Sentry's Flutter SDK doesn't currently support the `uploadNativeSymbols` flag from the Sentry Gradle Plugin. + + + +## Configuration Reference + +The following table lists all available configuration options for the Sentry Dart Plugin: + +
+ +| Option | Type | Default | Description | Environment Variable | +|--------|------|---------|-------------|---------------------| +| `project` | string | | **Required.** Your project's name (e.g., `sentry-flutter`) | `SENTRY_PROJECT` | +| `org` | string | | **Required.** Your organization's slug (e.g., `sentry-sdks`) | `SENTRY_ORG` | +| `auth_token` | string | | **Required.** The Sentry auth token | `SENTRY_AUTH_TOKEN` | +| `upload_debug_symbols` | boolean | `true` | Enables or disables automatic upload of debug symbols | | +| `upload_source_maps` | boolean | `false` | Enables or disables automatic upload of source maps | | +| `upload_sources` | boolean | `false` | Enables or disables source code upload | | +| `url` | string | | The URL of your Sentry instance | `SENTRY_URL` | +| `wait_for_processing` | boolean | `false` | Whether to wait for server-side processing of uploaded files | | +| `log_level` | string | `warn` | Configures the log level for sentry-cli (`trace`, `debug`, `info`, `warn`, `error`) | `SENTRY_LOG_LEVEL` | +| `release` | string | `name@version` from pubspec | The release version for source maps | `SENTRY_RELEASE` | +| `dist` | string | | Custom distribution identifier | `SENTRY_DIST` | +| `web_build_path` | string | `build/web` | The web build folder path | | +| `commits` | string | `auto` | Release commits integration | | +| `ignore_missing` | boolean | `false` | Ignore missing commits previously used in the release | | +| `bin_dir` | string | `.dart_tool/pub/bin/sentry_dart_plugin` | The folder where the plugin downloads the sentry-cli binary | | +| `bin_path` | string | | Path to a sentry-cli binary to use instead of downloading | | +| `sentry_cli_cdn_url` | string | `https://downloads.sentry-cdn.com/sentry-cli` | Alternative place to download sentry-cli | `SENTRYCLI_CDNURL` | + +
+ +## Troubleshooting + +If you encounter any issues with the Sentry Dart Plugin, refer to [Troubleshooting - Sentry Dart Plugin](/platforms/dart/guides/flutter/troubleshooting#sentry-dart-plugin) for solutions to common problems. diff --git a/platform-includes/debug-symbols/manual-upload/dart.mdx b/platform-includes/debug-symbols/manual-upload/dart.mdx new file mode 100644 index 0000000000000..f197e7fb3c1a1 --- /dev/null +++ b/platform-includes/debug-symbols/manual-upload/dart.mdx @@ -0,0 +1,31 @@ +## iOS and macOS + +Sentry requires a dSYM upload to symbolicate your crash logs. The symbolication process unscrambles Apple's crash logs to reveal the function, file names, and line numbers of the crash. + +[Learn how to upload the dSYM files](/platforms/apple/dsym/) + +## Android + +For Android applications, you need to upload mapping files manually with the Sentry CLI. + +[Learn how to upload Debug Information Files](/cli/dif/#uploading-files) + +## Android NDK + +For native code crashes in Android applications, you need to upload ELF DWARF debug files. + +[Learn how to upload Debug Information Files](/cli/dif/#uploading-files) + +If you're using a version of `sentry_flutter` earlier than 5.1, native symbolication on Android requires a specific configuration. Refer to [Troubleshooting](/platforms/dart/guides/flutter/troubleshooting/#native-symbolication-on-android) for more information. + + + +Sentry's Flutter SDK doesn't currently support the `uploadNativeSymbols` flag from the [Sentry Gradle Plugin](/platforms/android/configuration/gradle/). + + + +## Web + +For web applications, you need to upload source maps to get readable stack traces. + +[Learn how to upload Source Maps](/cli/releases/#upload-source-maps) \ No newline at end of file diff --git a/redirects.js b/redirects.js index a3521ae2e5217..d826b517c583d 100644 --- a/redirects.js +++ b/redirects.js @@ -1005,6 +1005,30 @@ const userDocsRedirects = [ source: '/platforms/flutter/:path*', destination: '/platforms/dart/guides/flutter/:path*', }, + { + source: '/platforms/dart/guides/flutter/upload-debug/', + destination: '/platforms/dart/guides/flutter/debug-symbols/', + }, + { + source: '/platforms/dart/guides/flutter/upload-debug/#when-to-upload', + destination: '/platforms/dart/guides/flutter/debug-symbols/#when-to-upload-debug-symbols', + }, + { + source: '/platforms/dart/guides/flutter/upload-debug/#source-context', + destination: '/platforms/dart/guides/flutter/debug-symbols/dart-plugin/#configuration', + }, + { + source: '/platforms/dart/guides/flutter/upload-debug/#uploading-source-code-context-for-flutter-android-ios-and-macos', + destination: '/platforms/dart/guides/flutter/debug-symbols/manual-upload/', + }, + { + source: '/platforms/dart/guides/flutter/upload-debug/#uploading-for-android-ndk', + destination: '/platforms/dart/guides/flutter/debug-symbols/manual-upload/#android-ndk', + }, + { + source: '/platforms/dart/guides/flutter/upload-debug/#automatically-upload-debug-symbols', + destination: '/dart/guides/flutter/debug-symbols/dart-plugin/', + }, { source: '/platforms/dart/guides/flutter/configuration/integrations/:path*', destination: '/platforms/dart/guides/flutter/integrations/:path*', diff --git a/src/components/onboarding/index.tsx b/src/components/onboarding/index.tsx index 9538b82487f25..03d002d6387c0 100644 --- a/src/components/onboarding/index.tsx +++ b/src/components/onboarding/index.tsx @@ -51,7 +51,7 @@ const optionDetails: Record< ), }, 'source-context': { - name: 'Source context', + name: 'Source Context', description: ( Upload your source code to allow Sentry to display snippets of your code next to @@ -59,6 +59,24 @@ const optionDetails: Record< ), }, + dsym: { + name: 'dSYM', + description: ( + + Debug symbols for iOS and macOS that provide the necessary information to convert + program addresses back to function names, source file names, and line numbers. + + ), + }, + 'source-maps': { + name: 'Source Maps', + description: ( + + Source maps for web applications that help translate minified code back to the + original source for better error reporting. + + ), + }, opentelemetry: { name: 'OpenTelemetry', description: Combine Sentry with OpenTelemetry., @@ -71,6 +89,8 @@ const OPTION_IDS = [ 'profiling', 'session-replay', 'source-context', + 'dsym', + 'source-maps', 'opentelemetry', ] as const; diff --git a/yarn.lock b/yarn.lock index f572dc7fc8386..2d702def6a93a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10459,9 +10459,9 @@ prisma@^5.8.1: fsevents "2.3.3" prismjs@^1.23.0: - version "1.29.0" - resolved "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz" - integrity sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q== + version "1.30.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.30.0.tgz#d9709969d9d4e16403f6f348c63553b19f0975a9" + integrity sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw== progress@^2.0.3: version "2.0.3" @@ -13043,4 +13043,4 @@ zod@^3.22.4: zwitch@^2.0.0, zwitch@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz" - integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== + integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== \ No newline at end of file