FractalBob
FractalBob

Reputation: 3564

Crashlytics is logging crashes with the wrong line number

I've been receiving a number of crash reports from a number of users on different devices, all happening on line 4 of my app:

enter image description here enter image description here enter image description here

But line 4 is just an import:

enter image description here

I'm running Android Studio 3.6.1 on a Linux laptop.

Upvotes: 7

Views: 1170

Answers (2)

bikes
bikes

Reputation: 131

Vít Kapitola's answer is not enough for my problem. In addition;
Add your -keepattributes LineNumberTable,SourceFile and -renamesourcefileattribute SourceFile to your proguard.pro file.

For more information: https://developer.android.com/build/shrink-code#retracing

Upvotes: 0

Vít Kapitola
Vít Kapitola

Reputation: 549

In my case the problem was not in Firebase but in R8 minifying. As pointed here try to add -keepattributes LineNumberTable,SourceFile to your proguard.pro file. It should help.

Upvotes: 2

Related Questions