错误的行号谷歌播放崩溃报告

cod*_*rox 6 android proguard

我有这样的谷歌播放崩溃

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)
Run Code Online (Sandbox Code Playgroud)

这里的行号SourceFile:28不正确为什么?

我上传了带有 proguard 签名的App Bundle

根据无需将映射文件上传到 App Bundle 中的控制台

即使行号不正确,为什么?

我也

添加这个

-keepattributes SourceFile,LineNumberTable

-renamesourcefileattribute 源文件

线路输入 proguard-rules.pro

即使行号不正确,为什么?

小智 -2

根据 Android 文档,

R8 混淆了代码后,理解堆栈跟踪就很困难(如果不是不可能的话),因为类和方法的名称可能已更改。除了重命名之外,R8 还可以更改堆栈跟踪中存在的行号,以在写入 DEX 文件时进一步节省大小。幸运的是,R8每次运行时都会创建一个mapping.txt文件,其中包含映射到原始名称的混淆后的类、方法和字段名称。该映射文件还包含将行号映射回原始源文件行号的信息。R8将文件保存在<module-name>/build/outputs/mapping/<build-type>/目录中。

因此,您需要找到mapping.txt文件,并在每次推送新版本时将其上传到google play控制台。

您可以在 Android 开发人员指南上找到更多相关信息。