Crashlitycs reporting wrong line number after kotlin migration
Asked Answered
T

2

10

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

Treharne answered 26/9, 2018 at 19:53 Comment(7)
Is that from the version that's been migrated? The files are java so I don't think it is.Enact
Its a library error in java, but both the java and kotlin files shows wrong line numbers: crashes.to/s/63aab3a5855Treharne
How far off is the line number?Loy
A lot, always shows a low value like 1,2,11 etc, and the line is 200, 300 or soTreharne
Did you find a fix? I'm having the same problem. Interestingly, I upload my mapping file to the Google Play Console and the console reports the correct line numbers.Inspire
Also having same issue. Has anyone found the fix for this?Durand
@JordyMendoza I've found the solution to this, posted as answerOutguard
T
-2

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

Treharne answered 16/2, 2019 at 3:39 Comment(1)
Hey! How did you generate the share link ie crashes.to/s/419b5b28766. Can you please answer the question here. #55758370Dismiss
O
4

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

Outguard answered 4/3, 2020 at 17:17 Comment(3)
Issue tracking proguard upgrade is here: issuetracker.google.com/issues/150830809Lamprophyre
Using proguard 6.2.2 does not fix this issue for Kotlin code. The only difference in the output is that the file names are converted from .kt to .java, yet the line numbers are still wrong.Lamprophyre
Checked ProGuard 7.2.1 and it works, line numbers are correct.Nidify
T
-2

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

Treharne answered 16/2, 2019 at 3:39 Comment(1)
Hey! How did you generate the share link ie crashes.to/s/419b5b28766. Can you please answer the question here. #55758370Dismiss

© 2022 - 2024 — McMap. All rights reserved.