[英]How do I get Firebase to tell me the exact line of code a user crashed at?
If you are using Proguard try this workaround:如果您使用 Proguard,请尝试以下解决方法:
There will be a file named proguard-rules.pro in your Gradle Scripts section on Android Studio/ or in app folder of your project in your explorer.在 Android Studio/ 的Gradle 脚本部分或资源管理器中项目的 app 文件夹中,将有一个名为proguard-rules.pro的文件。
In this file uncomment this line:在这个文件中取消注释这一行:
-keepattributes SourceFile,LineNumberTable
This will keep your ClassName and line Number OK.这将使您的 ClassName 和行号保持正常。
If you want to hide your className uncomment this line too.如果你想隐藏你的 className 也取消注释这一行。
-renamesourcefileattribute SourceFile
And also write this line at last最后还写了这一行
-printmapping mapping.txt
This line will generate a mapping.txt file (which you can find in the app folder) to deobfuscate your stack trace when you publish the app in the playstore.这一行将生成一个mapping.txt文件(您可以在 app 文件夹中找到),以便在您在 Playstore 中发布应用程序时对堆栈跟踪进行反混淆处理。
After doing all this, create a new release build of your app and update your existing build.完成所有这些之后,为您的应用程序创建一个新的发布版本并更新您现有的版本。 Your crash report should work fine now.
您的崩溃报告现在应该可以正常工作了。
If your app is available in the play store, with the apk you need to upload the generated mapping.txt file also.如果您的应用在 Play 商店中可用,则您还需要使用 apk 上传生成的mapping.txt文件。 (If you are uploading aab file you don't need to upload it)
(如果你是上传aab文件就不需要上传)
To upload the mapping file in the new play console follow these steps:要在新的播放控制台中上传映射文件,请执行以下步骤:
This should work.这应该有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.