简体   繁体   English

Firebase崩溃报告包含带有<OR>的堆栈跟踪

[英]Firebase crash report contains stack trace with <OR>

I have an app in production and I'm using Firebase for error and crash logging. 我有一个正在制作的应用程序,我正在使用Firebase进行错误和崩溃日志记录。 Lately, I've been seeing some lines in the stack trace of the exceptions, starting with <OR> . 最近,我在异常的堆栈跟踪中看到了一些行,从<OR> Below is an example taken directly (save for the package name) from an exception reported by Firebase: 以下是Firebase报告的异常直接(保存包名称)的示例:

Exception java.lang.NullPointerException: Attempt to invoke interface method 'void com.mycompany.myapp.managers.b$a.f()' on a null object reference
com.mycompany.myapp.managers.PermissionManager.getInstance (PermissionManager.java)
<OR>.checkPermission (PermissionManager.java)
<OR>.onRequestPermissionsResult (PermissionManager.java)
com.mycompany.myapp.activities.ShareImageActivity.onSaveShare (ShareImageActivity.java)
com.mycompany.myapp.activities.ShareImageActivity$3.onClick (ShareImageActivity.java)

I know that this is not a regular stack trace since onRequestPermissionResults does not call checkPermission and checkPermission does not call PermissionManager.getInstance . 我知道这不是常规的堆栈跟踪,因为onRequestPermissionResults不调用checkPermissioncheckPermission不调用PermissionManager.getInstance I assume this is one of the ways Android obfuscates the stack trace for the sake of security, but I couldn't find any documentation on this. 我认为这是Android为了安全起见而混淆堆栈跟踪的方法之一,但我找不到任何关于此的文档。 Does anyone know how to interpret this stack trace? 有谁知道如何解释这个堆栈跟踪?

The you see here is an indication that that Crash Reporting could not determine the actual object at that point. 您在此处看到的是指示崩溃报告无法确定此时的实际对象。 Currently, there is a known situation with Proguard deobfuscation where it could be ambiguous which object is the target here. 目前,已知Proguard反混淆的情况,其中对象是此处的目标可能是模糊的。 This could be the case if you're stripping line numbers from your classes, which it looks like you are doing. 如果您从类中删除行号,就可能出现这种情况,这看起来就像您正在做的那样。 This situation may improve if you are able to change your Proguard settings to remove the stripping of line numbers. 如果您能够更改Proguard设置以删除行号的剥离,则可能会改善这种情况。

Add this to your proguard-rules.pro : 将其添加到您的proguard-rules.pro

// obfuscate file name and keep line numbers
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

It should remove ambiguity and you should not see <OR> in your stacktrace anymore. 它应该消除歧义,你不应该再看到堆栈跟踪中的<OR>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM