Showing full stacktraces

Bugsnag supports unminifying and demangling stacktraces using ProGuard files, 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 and NDK 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:4.+'
    }
}
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, and R8 mapping file generated for every build.

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

bugsnag {
    autoUpload false
}

Uploading NDK Symbols

To enable symbol map upload, set ‘ndk’ to 'true’ in your 'bugsnag’ configuration block, and set the target path for your compiled shared object files using 'sharedObjectPath’:

bugsnag {
    ndk true
    sharedObjectPath "../unityLibrary/src/main/jniLibs"
}

Note: Unity library files such as libil2cpp.so and libunity.so do not contain debug information so these will not be uploaded.