问题
I use crashlytics to send my reports but crashs not de-obfuscated like this:
Fatal Exception: c.a
I readed here and added
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
to my proguard-rules file and there is no
-printmapping mapping.txt
in my configuration files. this is my build.gradle buildTypes part:
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug_server {
minifyEnabled false
debuggable true
matchingFallbacks = ['release']
}
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-DEBUG'
minifyEnabled false
}
}
not all of my crashes are like this and I updated crashlytics to 2.9.4 version.
UPDATE:
I just skipped this
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
as I don't need to skip running proguard on Crashlytics.
UPDATE2: v2.9.9 of crashlytics. Not fixed until now. I can't detect the real cause of bugs.
回答1:
You have to add an extra rule to proguard file to keep all Kotlin exceptions
-keep public class * extends java.lang.Exception
回答2:
I also had the problem.
Have you tried adding firebase-crash
?
build.gradle(app level) in dependencies
.
apply plugin: 'com.google.firebase.firebase-crash'
android{
...
}
and
implementation 'com.google.firebase:firebase-crash:16.2.1'
build.gradle(Proejct level)
buildscript {
repositories {
jcenter()
// ...
}
dependencies {
// ...
// For Android Studio 2.x, use firebase-plugins version 1.1.1
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// For Android Studio 3.0, use firebase-plugins version 1.1.5
//classpath 'com.google.firebase:firebase-plugins:1.1.5'
}
}
Try this and, if it doesn't solve your problem, let me know.
Plus, using -keep
is not recommended.
Alternatively, you can check ANR & Crash
on Google Play Console
Go to your app, and open Android vitals
> ANR & Crash
Reference: https://firebase.google.com/docs/crash/android
来源:https://stackoverflow.com/questions/50998597/fabric-crashlytics-reports-crashes-in-obfuscated-format