Android ProGuard return Line Number

Add this line to your proguard-project.txt file.

# will keep line numbers and file name obfuscation
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

https://www.guardsquare.com/en/products/proguard/manual/usage


When you create a new Android project, it tell you about which lines you might want to uncomment:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

So, you should consider having these:

-keepattributes SourceFile,LineNumberTable
-renamesourcefileattribute SourceFile

However, note that for some reason, Firebase Crashlytics team told me this line might interfere with their service:

-renamesourcefileattribute SourceFile

so you might not see good information of crashes stack trace if you use it.