Skip to content

Flutter

Take advantage of our Real User Monitoring (RUM) CLI to upload Dart symbols and source maps for your Flutter applications to the Coralogix RUM service.

Overview

Flutter applications compile to native code and can run on Android, iOS, and the web. Each target platform requires a different symbol or map file type for Coralogix to translate obfuscated stack traces back to your original source code. Upload each symbol type separately using the appropriate CLI command:
Symbol typeFileTarget platformCLI command
Dart symbols.symbolsAndroid, iOS, desktopupload-dart-symbols
dSYM.dSYMiOS (native crashes)upload-dsym
ProGuard mappingmapping.txtAndroidupload-proguard
JavaScript source maps.js.mapFlutter webupload-source-maps

Prerequisites

Before sending your data, verify that your S3 bucket has been properly set up and configured. For details on using an S3 bucket for data archiving, refer to the Coralogix documentation on S3 buckets.

API key

To use this API you need to create a personal or team API key. It's recommended to use permission presets, as they are automatically updated with all relevant permissions. Alternatively, you can manually add individual permissions.
PresetActionDescription
SourceMappingSOURCE-MAPPING:READMAPPING
SOURCE-MAPPING:UPLOADMAPPING
Read RUM source maps
Upload RUM source maps

Install the RUM CLI

1.

Open a terminal or command prompt.

2.

Run the following command to install the CLI globally:

npm i @coralogix/rum-cli

3.

Once the installation is complete, you can use the CLI by running the coralogix-rum-cli command in your terminal.

Upload symbols and source maps

Upload each symbol type separately using the matching CLI command.

Upload Dart symbols

coralogix-rum-cli upload-dart-symbols -k <privateKey> -a <application> -v <version> -f <folderPath> -e <env> -c <commitHash> -n <repoName> -o <orgName>
OptionDescription
-k, --private-key <privateKey>Your API key to authenticate with the Coralogix API
-a, --application <application>Name of the application
-v, --version <version>The application version. Must match the version used by the RUM SDK.
-f, --folder-path <folderPath>Path to the .symbols file
-e, --env <env>The region associated with your Coralogix domain: EU1, EU2, AP1, AP2, AP3, US1, US2
-c, --commit-hash <commitHash>GitHub commit hash (optional)
-n, --repo-name <repoName>GitHub repository name (optional)
-o, --org-name <orgName>GitHub organization name (optional)
--overrideOverride existing Dart symbols (optional)
--mergeMerge with existing Dart symbols (optional)

Upload dSYM (iOS)

coralogix-rum-cli upload-dsym -k <privateKey> -a <application> -v <version> -f <folderPath> -e <env> -c <commitHash> -n <repoName> -o <orgName>
OptionDescription
-k, --private-key <privateKey>Your API key to authenticate with the Coralogix API
-a, --application <application>Name of the application
-v, --version <version>The application version. Must match the version used by the RUM SDK.
-f, --folder-path <folderPath>Path to the .dSYM file
-e, --env <env>The region associated with your Coralogix domain: EU1, EU2, AP1, AP2, AP3, US1, US2
-c, --commit-hash <commitHash>GitHub commit hash (optional)
-n, --repo-name <repoName>GitHub repository name (optional)
-o, --org-name <orgName>GitHub organization name (optional)

Upload ProGuard mapping (Android)

coralogix-rum-cli upload-proguard -k <privateKey> -a <application> -v <version> -f <folderPath> -e <env> -c <commitHash> -n <repoName> -o <orgName>
OptionDescription
-k, --private-key <privateKey>Your API key to authenticate with the Coralogix API
-a, --application <application>Name of the application
-v, --version <version>The application version. Must match the version used by the RUM SDK.
-f, --folder-path <folderPath>Path to the mapping.txt file
-e, --env <env>The region associated with your Coralogix domain: EU1, EU2, AP1, AP2, AP3, US1, US2
-c, --commit-hash <commitHash>GitHub commit hash (optional)
-n, --repo-name <repoName>GitHub repository name (optional)
-o, --org-name <orgName>GitHub organization name (optional)

Upload JavaScript source maps (Flutter web)

coralogix-rum-cli upload-source-maps -k <privateKey> -a <application> -v <version> -f <folderPath> -e <env> -c <commitHash> -n <repoName> -o <orgName>
OptionDescription
-k, --private-key <privateKey>Your API key to authenticate with the Coralogix API
-a, --application <application>Name of the application
-v, --version <version>The application version. Must match the version used by the RUM SDK.
-f, --folder-path <folderPath>Path to the folder containing the .js.map files
-e, --env <env>The region associated with your Coralogix domain: EU1, EU2, AP1, AP2, AP3, US1, US2
-c, --commit-hash <commitHash>GitHub commit hash (optional)
-n, --repo-name <repoName>GitHub repository name (optional)
-o, --org-name <orgName>GitHub organization name (optional)

Upload symbols using a script

To simplify uploading symbols using the Coralogix RUM CLI, you can create a bash script that automates the task. Follow these steps to set up the script for CI and non-CI integrations.

CI integration

1.

Create a new file named upload-flutter-symbols.sh and open it for editing.

2.

Copy and paste the following script into the file, replacing the placeholder values with your actual information:

#! /usr/bin/env bash

# Replace these values with your actual information
REPO_NAME="your-repo-name"
ORG_NAME="your-github-username"
APPLICATION="your-application-name"
ENV="your-environment"
PRIVATE_KEY="your-coralogix-private-key"
VERSION="your-application-version"
DART_SYMBOLS_PATH="path/to/app.symbols"
DSYM_PATH="path/to/App.dSYM"
PROGUARD_PATH="path/to/mapping.txt"
JS_MAPS_PATH="path/to/web/source-maps"

# Get the commit hash using git rev-parse
COMMIT_HASH=$(git rev-parse HEAD)

# Upload Dart symbols
coralogix-rum-cli upload-dart-symbols -k "$PRIVATE_KEY" -a "$APPLICATION" -v "$VERSION" -f "$DART_SYMBOLS_PATH" -e "$ENV" -c "$COMMIT_HASH" -n "$REPO_NAME" -o "$ORG_NAME"

# Upload dSYM (iOS only)
coralogix-rum-cli upload-dsym -k "$PRIVATE_KEY" -a "$APPLICATION" -v "$VERSION" -f "$DSYM_PATH" -e "$ENV" -c "$COMMIT_HASH" -n "$REPO_NAME" -o "$ORG_NAME"

# Upload ProGuard mapping (Android only)
coralogix-rum-cli upload-proguard -k "$PRIVATE_KEY" -a "$APPLICATION" -v "$VERSION" -f "$PROGUARD_PATH" -e "$ENV" -c "$COMMIT_HASH" -n "$REPO_NAME" -o "$ORG_NAME"

# Upload JavaScript source maps (Flutter web only)
coralogix-rum-cli upload-source-maps -k "$PRIVATE_KEY" -a "$APPLICATION" -v "$VERSION" -f "$JS_MAPS_PATH" -e "$ENV" -c "$COMMIT_HASH" -n "$REPO_NAME" -o "$ORG_NAME"

Note: The $VERSION must match the version field in your RUM SDK initialization.

Non-CI integration

1.

Open a terminal window.

2.

Run the appropriate command for each symbol type you need to upload. For example, to upload Dart symbols:

coralogix-rum-cli upload-dart-symbols -k "$PRIVATE_KEY" -a "$APPLICATION" -v "$VERSION" -f "$DART_SYMBOLS_PATH" -e "$ENV" -c "$COMMIT_HASH" -n "$REPO_NAME" -o "$ORG_NAME"

Note: The $VERSION must match the version field in your RUM SDK initialization.

Optional GitHub information

Use this GitHub information to add context to your uploaded symbols.
OptionDescription
-c, --commit-hash <commitHash>The GitHub commit hash associated with the symbols. Including this hash helps track issues to a specific commit.
-n, --repo-name <repoName>The GitHub repository where the source code is hosted. Helps correlate symbols with the correct repository.
-o, --org-name <orgName>Your GitHub organization name. Helps attribute symbols to the appropriate organization. These options are not mandatory and can be omitted if not applicable.

Available environments

EnvironmentEndpointRegion
EU1https://ng-api-grpc.coralogix.com:443eu-west-1, Ireland
EU2https://ng-api-grpc.eu2.coralogix.com:443eu-north-1, Stockholm
US1https://ng-api-grpc.coralogix.us:443us-east-2, Ohio
US2https://ng-api-grpc.cx498.coralogix.com:443us-west-2, Oregon
AP1https://ng-api-grpc.app.coralogix.in:443ap-south-1, Mumbai
AP2https://ng-api-grpc.coralogixsg.com:443ap-southeast-1, Singapore
AP3https://ng-api-grpc.ap3.coralogix.com:443ap-southeast-3, Asia Pacific (Jakarta)

Limitations

  • Dart symbols: 400MB per file
  • JavaScript source maps (Flutter web): 100MB per folder

Additional resources

DocumentationCoralogix Real User Monitoring
External linksCoralogix RUM CLI Library

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].