This plugin is used to upload your Proguard/Dexguard/R8 mapping files to Datadog to get a complete RUM Error Tracking experience.
Once your mapping file are uploaded, any error/crash reported through RUM will have a deobfuscated stacktrace, enabling an easy diagnosis of the root cause of the error.
Add the following line to your build.gradle
file.
plugins {
id("com.datadoghq.dd-sdk-android-gradle-plugin") version "x.y.z"
}
You can configure the plugin by adding the following block at the end of your build.gradle
file.
datadog {
versionName = "1.3.0" // Optional, by default it is read from your Android plugin configuration's version name
serviceName = "my-service" // Optional, by default it is read from your Android plugin configuration's package name
site = "US" // Optional, can be "US", "EU" or "GOV". Default is "US"
checkProjectDependencies = "warn" // Optional, can be "warn", "fail" or "none". Default is "fail". Will check if Datadog SDK is in the project dependencies.
mappingFilePath = "path/to/mapping.txt" // Optional, provides a custom mapping file path. Default is "buils/outputs/mapping/{variant}/mapping.txt".
}
If you're using variants, you can set a custom configuration per variant using the following syntax.
datadog {
site = "US" // Variants with no configurations will use this as default
variants {
fr {
site = "EU"
mappingFilePath = "path/to/fr/mapping.txt"
}
}
}
This plugin supports Gradle configuration cache starting from the version 1.1.0
, but to have this support you need to disable SDK dependency check by setting checkProjectDependencies
to none
:
datadog {
...
checkProjectDependencies = "none"
...
}
Only stacktraces in errors/crashes reported through RUM will be deobfuscated; errors in Datadog Logs won't be deobfuscated.
If you encounter any issue when using the Gradle Plugin for Datadog Android SDK, please take a look at the existing issues.
Pull requests are welcome. First, open an issue to discuss what you would like to change. For more information, read the Contributing Guide.