Class name is not appearing in error Android Studio

跟風遠走 提交于 2020-06-27 17:00:09

问题


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)

回答1:


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

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

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 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.

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.



来源:https://stackoverflow.com/questions/61708063/class-name-is-not-appearing-in-error-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!