问题
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