Dart symbol upload

Upload Dart symbol files to allow BugSnag to symbolicate Dart stacktraces.

Overview

If you build your Flutter application with debug symbols stripped (--strip-debug-info) you will need to upload the generated symbol files to BugSnag to see the source file, line number and method in Dart error stacktraces.

Uploading mapping files

To send Dart symbol mapping files to BugSnag, POST them to https://upload.bugsnag.com/dart-symbol (or the address of your upload server, if using BugSnag On-premise) with the following parameters:

  • symbolFile - the path to the Dart symbol file.
  • apiKey - your BugSnag integration API key for this application.
  • buildId - the unique ID of the build of the binary that the symbol file applies to. This is used to determine the correct symbols file to use for a given stack frame.
  • appVersion - (optional) the version of the application.
  • appVersionCode - (optional) the version code for the application (Android only).
  • appBundleVersion - (optional) the bundle version for the application (iOS only).
  • platform - (optional) the application platform, either android or ios
  • overwrite - (optional) whether to overwrite any existing symbol file with a matching buildId, either true or false

cURL example

Here’s an example request with curl, where the ’@’ sign indicates that the symbolFile parameter is an uploaded file:

$ curl --http1.1 \
    "https://upload.bugsnag.com/dart-symbol" \
    -F symbolFile=@path/to/example.dart.symbols \
    -F apiKey=YOUR_API_KEY_HERE \
    -F buildId=11111111BBBB3333DDDD555555555555F \
    -F appVersion=1.2.3 \
    -F appVersionCode=1.2.3 \
    -F platform=android \
    -F overwrite=true

Response codes

If the file is accepted then an HTTP 202 response will be returned with the body “Accepted”.

If not, there are several possible problems which will be indicated with an HTTP 4XX response:

  • 400 - missing required file - indicates that the file is missing.
  • 400 - missing required param - indicates that a required parameter is missing.
  • 400 - invalid file format - indicates that the uploaded symbols file was in an incorrect format (not ELF)
  • 400 - invalid buildId - indicates that the provided buildId was not valid
  • 422 - received empty file - indicates that the uploaded file is empty
  • 401 - invalid apiKey - indicates that the provided apiKey doesn’t correspond to a BugSnag project.
  • 409 - duplicate symbols file - indicates that BugSnag already has a file for this build identifier. You can ignore this error by using the overwrite parameter.

To determine the buildId and for more information on how to upload symbols, see Showing full Flutter stacktraces.