There came a time that I received some stack trace exception logs which showed obfuscated classes from my Android app.

Now, the problem is how do I know which obfuscated class is linked to my original classes.

The answer lies in the mapping.txt file that is generated by ProGuard. This can be found in your project main’s build/outputs/mapping/[…flavor_if_any…]/mapping.txt folder.

There is also a tool that can give you a better visual result compared to manually looking at the mapping.txt file and your stack trace file which can be a hassle especially if you have only 1 monitor screen as it is cumbersome to keep on alt-tabbing just to pinpoint the class you are looking for.

The command is

If you are using 3rd party libaries in your project, there is no sense in obfuscating, minifying or optimizing the classes using ProGuard.

You need to manually exclude them by adding commands in the ProGuard file or else your app may crash and give you Exception messages that are confusing.

In my case, I always got the ExceptionInInitializer which really had me dumbfounded because it worked in Eclipse.

The difference though was that I did not use ProGuard in Eclipse so that took me a while to figure out the cause.

Once I realized it, it was easy to fix the problem. To exclude libraries from ProGuard, check the ancestor package names of the classes, then do it like this:

Related Posts Plugin for WordPress, Blogger...