views:

52

answers:

2

When I got something like this

ERROR/AndroidRuntime(18677): Caused by: java.lang.NullPointerException
ERROR/AndroidRuntime(18677):     at com.companyname.a.a.a(Unknown Source)

How can I know where the problem is and debug this issue? I only got the mapping output from ProGuard and don't know the line number. Thanks.

A: 

The point of using ProGuard is to make the application file difficult to understand and reverse engineer. Function and variable names are scrambled during this process.

Obviously, the debugger got lost in a mess of meaningless symbols. Look at the package name on the second line : the three last elements were replaced by "a" letters.

Try disabling ProGuard during the development process. Once your app functions as you expect, enable ProGuard before buillding for distribution.

DavLink
But what if the application is published to market and have user feedback bugs?
shiami
+2  A: 

To make use of any stack traces from your Android Market account, you can use your map file, -printmapping, with ReTrace (ProGuard companion tool) to decode the stack trace. You can also decode by hand using the contents of the map file, but this is tedious.

In the ProGuard Manual under examples, there is a section about producing useful obfuscated stack traces including how to keep line numbers.

Unfortunately if you did not set the ProGuard to keep the line numbers, then you will only be able to identify the method that throws the exception.

cistearns
Thanks. That's what I'm looking for!
shiami