Last Updated: November 21, 2017
· handtwerk

Configure ProGuard to Retain Line Numbers in Stack Traces

Want to obfuscate your code but still have line numbers in your stack traces? Add these two lines to your ProGuard config:

-renamesourcefileattribute SourceFile    
-keepattributes SourceFile,LineNumberTable

The first line ensures that source file names are hidden (will be named "SourceFile" in stack traces), the second instructs ProGuard to include the line numbers.