Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong line number google play crash report

I have google play crash like this

java.lang.NullPointerException: 
  at java.util.Objects.requireNonNull (Objects.java:109)
  at f0.k.e.b.b.a.<init> (SourceFile:1)
  at com.activities.galleryscan.ScanBarcodeFromFileActivity$b.g (SourceFile:28)
  at h0.r.o.a.a.d (SourceFile:3)

Here the line number SourceFile:28 not correct why?

I was uploaded the App Bundle signed with proguard.

According to This no need to upload mapping file to console in App Bundle

even then line number not correct why?

And I also

add this

-keepattributes SourceFile,LineNumberTable

-renamesourcefileattribute SourceFile

lines in proguard-rules.pro

even then line number not correct why?

like image 982
code4rox Avatar asked May 06 '21 07:05

code4rox


People also ask

What is ANR in google Console?

Application Not Responding (ANR) errors are triggered when the UI thread of the application is not responding for more than 5 seconds. You can read more about ANRs and diagnosing ANRs in the Android documentation.


1 Answers

I was getting correct line numbers for Debug and incorrect ones for Release.

If your build config specified with debuggable=false then R8 generates incorrect line numbers.

To make it work correctly set debuggable=true Eg

buildTypes {
    debug {
        debuggable true
        minifyEnabled true
        proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
        signingConfig signingConfigs.debug
    }
    release {
        debuggable true
        minifyEnabled true
        proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
        signingConfig signingConfigs.release
    }
}
like image 52
William Avatar answered Sep 21 '22 06:09

William