问题
My Android release build uses the following proguard-rules.pro
-keepattributes Signature
-keepattributes *Annotation*
-keepattributes EnclosingMethod
-keepattributes InnerClasses
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-keepnames class com.mypackage.** { *; }
-keepclassmembers class com.mypackage.** { *; }
...
I'm uploading mapping.txt
along with the build when performing the Google Play console pre-launch testing. Any crashes during testing have the correct function / class information for my package, but the line numbers are completely incorrect:
Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.get(ArrayList.java:437)
at com.mypackage.MyClass1.getHistory(MyClass1.java:1) <-- this is incorrect
at com.mypackage.MyClass2.onCreate(MyClass2.java:9) <-- this is incorrect
at androidx.fragment.app.Fragment.performCreate(Fragment.java:6)
at b.m.b.g0.d(FragmentStateManager.java:5)
at b.m.b.g0.j(FragmentStateManager.java:33)
...
Any help much appreciated.
*** Update ***
I've tried running with the stand-alone R8 tool as per suggestion by @sgjesse in this and the deobfuscated line numbers are correct, so I'm assuming it's a funny with Google Play Console.
来源:https://stackoverflow.com/questions/64892774/google-play-console-incorrect-line-numbers-in-pre-launch-crash-report-using-map