问题
I user android/proguard/ACRA. Can anyone tell me please why the crash reports I am getting have incorrect line numbers (line number pointing at obviously a wrong statment)?
It is really annoying that I am unable to know the exact line number of the crash so I can't fix my user's reported error Thank you
PS: I am using the mapping file corresponding to version I am releasing
回答1:
With some optimizations (notably class merging and method inlining), ProGuard may be unable to preserve all debug information, because the java class file format doesn't support it. The information may only be an approximation in those cases. These should be exceptions though; if the information is consistently wrong, you're probably using the wrong mapping file.
回答2:
I found the answer for who is interested. You should avoid (preverify, optimize, and shrink). This will display all lines numbers correctly as the code is not played with
回答3:
After hours of research and trying many approaches. I have found the solution.
Change
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt')...
to
proguardFiles getDefaultProguardFile(
'proguard-android.txt')...
来源:https://stackoverflow.com/questions/10921882/incorrect-line-number-with-acra