Showing full stacktraces

Bugsnag supports unminifying and demangling stacktraces using ProGuard files, Unity library symbols, NDK symbols and LLVM debug symbol maps (dSYMs), to show a full stacktrace with methods, file paths, and line numbers for Android and iOS projects in Unity.

Uploading debug symbol maps (dSYMs) for iOS

If you are using Bitcode, you will need to send dSYM files to Bugsnag in order to symbolicate native iOS stack traces. Our iOS symbolication guide provides details on how to automate this process.

Uploading mapping files for Android

If you have enabled ProGuard or use the NDK, you will need to send mapping files to Bugsnag in order to deobfuscate Android stack traces.

By using the Bugsnag Gradle Plugin, ProGuard, NDK, and Unity library mapping files will be automatically uploaded.

To do this we’d recommend adding Bugsnag Gradle Plugin to Unity.

Exported Android projects

If you have exported your Unity Android project, you can follow the Android instructions for the Bugsnag Gradle Plugin ensuring you edit your Launcher module AndroidManifest.xml and build.gradle files.

Adding Bugsnag Gradle Plugin to Unity

The Bugsnag Gradle Plugin is added directly though Unity and uploads ProGuard and NDK mapping files as part of the Android Unity build process

When building from Unity, mappings are only uploaded for non-development builds, ensure Build settings -> Development build is unchecked.

Enable Custom Manifest

Player settings -> Android tab -> Publishing Settings -> Build

This enables edits to the AndroidManifest.xml and build.gradle files via the LauncherManifest and LauncherTemplate templates.

Enable manifest

Basic Configuration

By default, the Bugsnag Gradle Plugin will read your API key from your manifest file. Ensure your API key is present in the section of your LauncherManifest file:

<meta-data
    android:name="com.bugsnag.android.API_KEY"
    android:value="your-api-key-here" />

You can find your API key when creating a project in your Bugsnag dashboard, or later from your project settings page.

Installation

Add the following to the LauncherTemplate file:

buildscript {
    dependencies {
        // ...
        classpath "com.bugsnag:bugsnag-android-gradle-plugin:5.+"
    }
}
apply plugin: "com.android.application"
apply plugin: "com.bugsnag.android.gradle"
// ...

Uploading ProGuard, DexGuard and R8 Mappings

By default, this plugin will automatically upload any ProGuard/DexGuard/R8 mapping files for every non-development build.

If you’d prefer to disable this automatic uploading, set the uploadJvmMappings property in your app’s LauncherTemplate file:

bugsnag {
    uploadJvmMappings = false
}

Uploading NDK Symbols

By default, this plugin will automatically upload mapping files for shared objects for every non-development build.

If you’d prefer to disable this automatic uploading, set the uploadNdkMappings property in your app’s LauncherTemplate file:

bugsnag {
    uploadNdkMappings = false
}

Uploading Unity Symbols

By default for projects that use IL2CPP, the plugin will upload Unity library mapping files for every non-development build. This improves the symbolication of stack frames originating from Unity Library code.

If you’d prefer to disable this automatic uploading, set the uploadNdkUnityLibraryMappings property in your app’s LauncherTemplate file:

bugsnag {
    uploadNdkUnityLibraryMappings = false
}

Exported Android Projects

If you export an Android project from Unity then you should enable the “Create symbols.zip” checkbox:

Create symbols.zip

This exports an archive of Unity symbols to the same directory as your Gradle project. Do not move or rename this archive as otherwise Bugsnag’s gradle plugin will be unable to upload the symbols.

Unity 2020 is affected by a bug where the symbols.zip archive is not exported for Gradle projects. If you wish to symbolicate Unity library frames you should use a different version of Unity or build directly from the Unity editor.