Ever since Google introduced R8 I'm not getting my crashes stacktraces in crashlytics deobfuscated.
I used to get them before, but not anymore, have the configuration described in this page.
What should I do to get my crashlytics crashes report deobfuscated, the Stack Traces from Google Play are deobfuscated.
proguard-rules.pro
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
@GuanacoDevs are you using the plugin to upload the R8 mapping file to Crashlytics?
You need to use 1.28.0 or higher to get R8 to work:
https://docs.fabric.io/android/changelog.html#march-15-2019
Yes
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.0'
}
}
and in app:
dependencies {
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}
Do you see any errors in the logs? They would be in this file:
On Linux / Windows:
/.crashlytics/com.crashlytics.tools/crashlytics.log
On Mac:
~/Library/Caches/com.crashlytics/com.crashlytics.tools/crashlytics.log
There is an error but from dec '18.
I have saved the logs from what I think is the last production release that I have uploaded and published here if you get the chance to take a look at it.
This is how a crash looks on the Console:

Can't seem to find the same crash in Play Console, but another crash looks deobfuscated.
I'm using linux mint.
The full app build.gradleis:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 29
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.guanacodevs.ubv"
minSdkVersion 21
targetSdkVersion 29
//noinspection HighAppVersionCode
versionCode 2019062202
versionName "I帽aki 2.5.5"
resConfigs "en", "pt", "es"
vectorDrawables.generatedDensities = []
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
//
implementation 'com.android.billingclient:billing:1.2.2'
//
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
implementation 'com.google.android.material:material:1.0.0'
//
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-database:18.0.0'
implementation 'com.google.firebase:firebase-ml-vision:21.0.0'
implementation 'com.google.firebase:firebase-ads:18.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
//
implementation 'com.otaliastudios:cameraview:2.0.0-beta04'
implementation 'com.google.code.gson:gson:2.8.5'
//
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
and the project build.gradle:
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.28.0'
}
}
allprojects {
// tasks.withType(JavaCompile) {
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
// }
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Thank you for your time @samtstern
Hmmm I do see things in the logs that indicate the deobfuscation file should have been uploaded:
2019-06-22 02:48:34.987 [DEBUG] (Execution worker for ':' Thread 3) com.crashlytics - Uploading deobfuscation file
2019-06-22 02:48:34.992 [DEBUG] (Execution worker for ':' Thread 3) com.crashlytics - POST file: /home/racu/.crashlytics/com.crashlytics.tools/********************************************/deobs/db4bad94-d95e-4624-9124-a0dde6d753cc.zip to URL: https://cm.crashlytics.com/api/v3/platforms/android/code_mappings
2019-06-22 02:48:41.318 [DEBUG] (Execution worker for ':' Thread 3) com.crashlytics - POST response: [reqId=f62395bf6f551a20bc6a64fe49c1ef9f9229a2c3a6e98ed8] 202
2019-06-22 02:48:41.319 [DEBUG] (Execution worker for ':' Thread 3) com.crashlytics - Deobfuscation file(s) uploaded.
2019-06-22 02:49:48.581 [DEBUG] (Execution worker for ':' Thread 2) com.crashlytics - Invoked Crashlytics Developer Tools with arguments:
So I am not sure what's going on. I will have to ask around.
I have added to my application tag in the manifest
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="true" />
and removed from my Application class were used to initialize Crashlitycs, but I still can't get stack traces deobfucated.
private void configureCrashReporting() {
CrashlyticsCore crashlyticsCore = new CrashlyticsCore.Builder()
.disabled(BuildConfig.DEBUG)
.build();
Fabric.with(this, new Crashlytics.Builder().core(crashlyticsCore).build());
}
@GuanacoDevs had the same issue after updating to 'io.fabric.tools:gradle:1.31.0' crash reports are deobfuscated properly
@AndroidGecko Thank you, I'll try that and close this issue. If I still can't get deobfuscated stack traces I'll reopen.
Updating to io.fabric.tools:gradle:1.31.0 did not work, still can't get the stack traces deobfuscated, this is really painful.
What am I missing here?
Same problem.
same problem
also seeing the same issue after migrating to R8
While build your application to be release look for this task > "crashlyticsUploadDeobs" and check if it's executed correctly or not
you can also find more logs under
Library/Caches/com.crashlytics/com.crashlytics.tools/crashlytics.log
I couldn't find the file crashlytics.log anywhere on my computer
i updated fabric plugin to io.fabric.tools:gradle:1.31.0 and its working now
To add to oahmedazab's comment, you can specifically run:
./gradlew clean assembleDebug --console=plain
and see if the task "crashlyticsUploadDeobsDebug" appears.
You should be able to find the crashlytics.log in that path and that will tell you if the mapping file is getting successfully uploaded or not, but if that doesn't work, these are all possible paths:
Windows/Linux:
~/.crashlytics/com.crashlytics.tools/crashlytics.log
~/.crashlytics/com.crashlytics.tools.androidstudio/logs/crashlytics.log
~/.crashlytics/com.crashlytics.tools.intellij/logs/crashlytics.log
Mac:
~/Library/Caches/com.crashlytics/com.crashlytics.tools/crashlytics.log
~/Library/Caches/com.crashlytics/com.crashlytics.tools.androidstudio/logs/crashlytics.log
~/Library/Caches/com.crashlytics/com.crashlytics.tools.intellij/logs/crashlytics.log
We're not yet able to reproduce this problem, but it's interesting that for some people upgrading to Fabric Gradle plugin 1.31.0 helps but not for others. @oahmedazab are you able to observe any difference in the crashlytics.log between builds before upgrading and for builds after?
I get the same problem with io.fabric.tools:gradle:1.31.2.
Logs show that Deobfuscation file(s) uploaded, but stack traces in Crashlytics are obfuscated, for example b.a.a.a.s0.m.j1.l.
That was my mistake. I've looked into exception description, not stack trace. Stack trace is fine. Sorry.
We were struggling with this issue as well - thought bumping to 1.30+ would be the solution (per https://github.com/firebase/firebase-android-sdk/issues/745). What we ended up finding was that we were losing the deobfuscation only when distributing the apk through Firebase, and only when doing so via the appDistributionUploadRelease gradle command. (Manual APK uploads to Firebase were fine). In our case, we were running ./gradlew appDistributionUploadRelease after running ./gradlew assembleRelease both on their own. We realized the appDistributionUploadRelease task didn't call crashlyticsUploadDeobsRelease, and thus realized we should have been calling ./gradlew assembleRelease appDistributionUploadRelease as a single command. (As the docs state, sheesh!) Hopefully that will help someone some headache in the future (or help y'all potentially repro the issue :) )
Thanks all for the continued reports and information on R8 + Crashlytics. Has anyone tried this with Android Gradle plugin version 3.5.3 and can report back what the behavior is when using that version? We believe we've seen some improved behavior when using that version of AGP, but would like to confirm if there are any reports of this behavior in other setups.
Thanks @poko
We had the same issue but after we added the distributionUpload to the single-line command it is worked.
Thanks all for the continued reports and information on R8 + Crashlytics. Has anyone tried this with Android Gradle plugin version 3.5.3 and can report back what the behavior is when using that version? We believe we've seen some improved behavior when using that version of AGP, but would like to confirm if there are any reports of this behavior in other setups.
We were having this issue in a recent release, and it looks like upgrading the Gradle plugin version to 3.5.3 has solved it for us.
Most helpful comment
Same problem.