Jordy Mendoza
Jordy Mendoza

Reputation: 432

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

Upvotes: 10

Views: 2065

Answers (2)

MatPag
MatPag

Reputation: 44901

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

Upvotes: 4

Jordy Mendoza
Jordy Mendoza

Reputation: 432

I disabled R8 and it worked fine, the line code on reports now shows the correct line number

Upvotes: -2

Related Questions