If you are using ProGuard, DexGuard, or R8 to minify and optimize your app this will cause method and class names to become obfuscated in your stacktraces. Similarly, for applications which use the NDK, native stacktraces from C or C++ code consist of a list of addresses and numeric offsets.
In order for your stacktraces to remain readable in your dashboard, BugSnag requires that you upload your obfuscation mapping file and the symbols from any native code for each release of your app. This page describes how to upload these files as part of your build process.
Our command line tool provides a toolbox of commands for uploading files and creating builds on your dashboard after your app has been built. This is particularly useful for integrating CI and non-Gradle systems.
The simplest approach is to use the upload android-aab
command with an Android App Bundle (AAB) as it contains all the necessary files:
$ bugsnag-cli upload android-aab app/build/outputs/bundle/release/app-release.aab
Alternatively you can upload the Proguard/Dexguard/R8 mappings and NDK symbol files separately, pointing at the root of your project directory:
$ bugsnag-cli upload android-proguard /path/to/my-app
$ bugsnag-cli upload android-ndk /path/to/my-app
See the AAB, Proguard and NDK CLI command references for full details.
The BugSnag Gradle plugin is a thin wrapper for the BugSnag CLI (see above) and provides tasks and configuration hooks that your build tasks can depend on in order to incorporate BugSnag mapping/symbol file uploads into your Gradle build:
./gradlew bundleRelease bugsnagUploadReleaseBundle
See our Gradle plugin docs for installation steps and usage information.
The legacy BugSnag Android Gradle plugin is still available, but we recommend switching to our lighter-weight BugSnag Gradle plugin for most apps.
If you prefer, you can upload your mapping files directly to BugSnag using our APIs. For ProGuard, DexGuard, and R8 mapping files see the Android Mapping Upload API reference for more details. For NDK shared object files see the NDK Symbol Upload API reference for more details.
Uploaded mappings will only be applied to new error events. Existing error events will not be deobfuscated/symbolicated retroactively.
If you are using proguard-android-optimize.txt
settings then BugSnag will convert the stack traces to a human-readable format, but the original file names might not be available.
If the stack traces provided to BugSnag do not contain a valid file, then we will use the unqualified class name in place of the file name.
Symbol files for library modules can be uploaded by extracting the AAR and using the BugSnag CLI, running the android-ndk
command either from the root of the library directory or providing a path directly to the symbol file.
The shared object files within a library module (i.e. within the .aar
) do not typically contain debug symbols, and therefore you may need to ask the library’s developer to provide debug symbols. Alternatively if you complete the Android NDK build for the library yourself, then the intermediate shared object files will contain the symbols.
To check whether a shared object file contains debug symbols, run the file
command with the path to the shared object file. The output will include stripped
if the file has been stripped of debug symbols, and debug_info, not stripped
if it contains debug symbols.