Crashlytics reports showing wrong line number after migrating app to kotlin, i have already -keepattributes SourceFile,LineNumberTable
in my proguard file
An example of wrong line number report:
http://crashes.to/s/419b5b28766
The thing is R8 is applying extra optimizations to save space using small integer numbers instead of real line numbers.
The problem with de-obfuscation appears when you try to de-obfuscate using the retrace script inside the Android sdk folder at: /sdk/tools/proguard/bin/retrace.sh
The version of the proguard inside the tools folder is 4.7 which is unable to de-obfuscate optimized line number stacktrace.
The solution is to download the latest official proguard version here and use the retrace tool inside the bin folder, then the line numbers will be de-obfuscated correctly even with R8 enabled. You can verify it manually with
latest_proguard/bin/retrace.sh mapping.txt stacktrace.txt
Reference: https://issuetracker.google.com/issues/122752644
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With