0

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.

Simon Huckett
  • 482
  • 5
  • 13
  • I assume you are using R8 for minifying your app? Could I ask you to file a bug on http://issuetracker.google.com/issues/new?component=326788. It would be nice to figure out if the problem is in the generated mapping file or in Play. – MortenKJ Nov 20 '20 at 08:09
  • Thanks for replying. Initially I didn't have the `-renamesourcefileattribute`. Now I have that I can see that crashes and warnings are *not* being deobsfucated at all in my pre-launch reports. AFAIK I'm using R8 correctly via Android Studio. Will file a report when I have time. – Simon Huckett Nov 21 '20 at 09:08

0 Answers0