Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crashlitycs reporting wrong line number after kotlin migration

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

like image 786
Jordy Mendoza Avatar asked Sep 26 '18 19:09

Jordy Mendoza


1 Answers

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

like image 97
MatPag Avatar answered Nov 05 '22 09:11

MatPag