Closed orafaaraujo closed 4 months ago
Hi @orafaaraujo and thanks for submiting this issue.
Indeed it seems your mapping file is uploaded without its variants, and without it it can't be matched with stacktraces captured at runtime. The output should read:
Mapping file upload successful with tags
service:com.myapp
,version:3.0.0
,variant:qa
.
Can you share your build.gradle[.kts]
(including the part where you define your variants) to help us reproduce this issue on our side please?
Hey @xgouchet Thanks for the response!
I agree, the variant it's missing... below you can find my setup.
apply plugin: "com.android.application"
apply plugin: "com.datadoghq.dd-sdk-android-gradle-plugin"
android {
buildTypes {
debug {
debuggable true
signingConfig signingConfigs.signDebug
}
qa {
debuggable false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
signingConfig signingConfigs.signProd
}
qaautomation {
debuggable false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
signingConfig signingConfigs.signProd
}
release {
debuggable false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
signingConfig signingConfigs.signProd
}
applicationVariants.configureEach { variant ->
if (variant.getBuildType().minifyEnabled) {
tasks.named("minify${variant.name.capitalize()}WithR8").configure {
finalizedBy tasks.named("uploadMapping${variant.name.capitalize()}")
}
}
}
}
datadog {
site = "EU1"
}
We also bumped the version to the latest 1.12.0
buildscript {
dependencies {
classpath "com.datadoghq:dd-sdk-android-gradle-plugin:1.12.0"
}
}
I'm omitting some parts that I think it's not relevant, but please let me know if there is something that you could consider important.
Oh I get it, the main issue is that you're using the buildType as variant, instead of using flavors.
The general assumption is that the build type is usually debug
/release
, and that flavors will be added to have, for example a dev
/qa
/staging
/prod
variants (where the backend endpoints, or some features will change).
We will add a task in our roadmap to allow taking the buildType into account.
In the meantime, can you try using flavors (like the example below)? That way you can build a qaRelease
, qaAutomationRelease
and prodRelease
versions with independent mapping files.
android {
// …
flavorDimensions "version"
productFlavors {
dev {
dimension "version"
}
qa {
dimension "version"
}
qaAutomation {
dimension "version"
}
prod {
dimension "version"
}=
}
Hey @xgouchet
Oh, I see it. Is it possible to enable it at least for release
? Otherwise, we'll wait for the update. I prefer to not add new flavors for now.
Thanks once again.
If you only upload the mapping for your release build, you can pass in an empty string in the variant when initializing the SDK, and it'll use the release mapping files :
val config = Configuration.Builder(
clientToken = BuildConfig.DD_CLIENT_TOKEN,
env = BuildConfig.BUILD_TYPE,
variant = ""
)
Hey @xgouchet
I appreciate your inputs on this, but unfortunately this would not be possible us too as we have dedicate board to build types today.
We'll wait for the final solution, let me know if I can help with anything else.
Thanks!
Hey @xgouchet
One last question. Is it possible to manually upload the mapping file?
Thanks
Unfortunately so far no it's not possible.
Hello @orafaaraujo!
We changed the way the match for the deobfuscation happens between the event and mapping file in 1.13.x version of our Gradle Plugin, now mechanism relies on the unique Build ID, so it means the difference in the variant doesn't matter for the deobfuscation process.
To try it out you also need to have out Android SDK version 2.8.0 or above.
With that said, I'm closing this issue. Feel free to re-open it if needed.
Describe what happened Hello, I'm trying to upload the mapping file by using the steps on Android Crash Reporting and Error Tracking , but apparently, the variant is not being set.
On my
app/build.gradle
file, I'm setting up the site.I'm also setting up a dynamic way to call the task
uploadMapping[Variant]
:Which is working as expected.
For tests, I'm calling
uploadMapping[Variant]
directly.In short:
service:com.myapp
: correct ✔️version:3.0.0
: correct ✔️variant:
: empty ❌I believe because it is missing the
variant
, I still can not check deobfuscated classes on Datadog.I also tried setting up the variants as mentioned in the docs
But in this case, I'm only replacing the version, not adding the variant. No deobfuscation is happening in the Dashboard.
Steps to reproduce the issue:
Having multiple variants in the setup, try to upload the mapping file.
Describe what you expected:
Have the deobfuscation on the Datadog dashboard.
Let me know if you need any extra information.
Thanks!
Additional context