I've got a problem with my crash reports from Fabric Crashlytics when I enable Dexguard in my project.
I enabled Dexguard in my project and it works pretty well.
Then I followed the instructions in this this page and added the mentioned configurations to enable fabric de-obfuscate my stacktraces and show proper crash reports. Here's how I apply fabric and dexguard plugins in my main module's build.gradle
:
apply plugin: 'com.android.application'
apply plugin: 'dexguard'
apply plugin: 'io.fabric'
And here are the configurations in my proguard-project.txt
file:
# Fabric
#############################################################################
-keepattributes *Annotation*,SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-keepresourcexmlelements manifest/application/meta-data@name=io.fabric.ApiKey
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
#############################################################################
And here's how I use proguard-project.txt
in my release build:
buildTypes{
debug{
proguardFile getDefaultDexGuardFile('dexguard-debug-shrink.pro')
proguardFile 'proguard-project.txt'
}
release{
proguardFile getDefaultDexGuardFile('dexguard-release.pro')
proguardFile 'proguard-project.txt'
proguardFile 'dexguard-project.txt'
if(new File("$projectDir/../local.properties").exists()){
signingConfig signingConfigs.release
}
}
}
But when a crash is encountered in the release build the file name in which the crash has occurred is missing, but everything else is working correctly and the stacktrace is almost understandable. Here's a sample crash report:
As you can see in the crash report, only the file name is missing in the stacktrace. The other descriptions like line numbers and method names are completely OK.
Although using the complete method names like ir.X.ui.XMainActivity.throwSomething
and the line numbers in front of the Unknown Source
, I can conclude the file name in which the error has occured, I'd like my stacktraces to show the file names and be completely descriptive themeselves. I've tried many options and many trials and errors but the problem still exists.
Is there anything I'm missing? How can I solve this problem?
I'm using version 8.1.0.7
of Dexguard, version 1.21.7
of Fabric plugin and version 2.9.0
of Crashlytics library.
I updated the Fabric plugin to version 1.25.1
and the Crashlytics library to version 2.9.1
but the problem still exists.
I updated the Fabric plugin to version 1.25.2
, build tools version to 27.0.3
, and gradle plugin version to 3.1.0
but the problem still exists.
ir.resid.ui.ResidMainActivity.throwSomething (Unknown Source:87469)
– AdhamDexguard
orCrashlytics
's fault to me, not our configuration. – AdhamUnknown Source
is where the file name would be (e.g.Something.java:608
). You don't need that. The class name (ResidMainActivity
) and method name (throwSomething
) have resolved correctly and from that you can guess the file name or have the IDE find the class for you. This is OK. – Duelist