类名称未出现在错误的Android Studio中 [英] Class name is not appearing in error Android Studio

查看:119
本文介绍了类名称未出现在错误的Android Studio中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下错误中,您可以看到 RegisterActivity.a 类名以其他一些字符转换.当类名未出现在错误日志中时,有人可以建议我在这种情况下该怎么办.

In below error you can see RegisterActivity.a the class name is converted in some other characters. Can someone suggest what should I do in such a situation, when class name is not appearing in error logs.

 at com.abc.angpau.appClasses.activities.RegisterActivity.a(:53)
        at com.abc.angpau.appClasses.activities.c.a(Unknown Source:4)

推荐答案

您可能已经构建了发行版本,并且proguard处于活动状态.

You might have built a release version and proguard is active.

查看gradle文件.当您具有 minifyEnabled true 时,proguard处于活动状态.

Look at the gradle files. When you have minifyEnabled true proguard is active.

通常,您只想在发布模式下启用它,因此,如果发生崩溃,则可以使用所有原始名称进行调试.但是您可能需要暂时在调试中启用它,以测试启用proguard时一切正常.

Usually you only want to enable it in release mode, so you can debug with all the original names if a crash occurs. But you might want to enable it in debug for a moment to test everything works as expected when proguard is enabled.

Proguard使代码模糊不清,从而更改了vars,方法的名称……它还会生成一个映射文件,以便您可以执行相反的转换以读取堆栈跟踪.某些服务会使用此类映射来捕获崩溃,例如Firebase来消除崩溃.

Proguard obfuscates the code changing the name of vars, methods... It also generates a mapping file so that you can then do the opposite translation to read stack traces. This mapping is used by some services that capture crashes like firebase to desimbolicate them.

并且有一个配置文件,因此,如果不应混淆某些类/方法,则应使用它,通常在lib需要这样做时,它会为您提供proguard配置,以将名称保留在某些特定的类中.

And there is a config file so that if some classes/methods should not be obfuscated you should use it, usually when a lib requires this it provides you with the proguard config to keep names in some specific classes.

这篇关于类名称未出现在错误的Android Studio中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆