Android Tip: More detailed stack traces

I noticed that stack traces generated by my app does not show any source file information next to the method names in the stack. This was really annoying as it would make it more difficult to narrow down the line causing the exception. I suspected this was due to debug information not being generated by the compiler and with a little hunting around in settings found the way to enable it:

Right click the project and select "Properties" -> "Java Compiler" -> check the "Add source file name to generated class file" checkbox.

You will likely need to check the "Enable project specific settings" checkbox first enable changing this setting.

Now it prints prints the source file and the line number making it much easier to figure out the source of the exception without having to attach the debugger.

6 comments:

  1. Thanks for sharing this tip with us, not everyone is aware of it and this need to be shared by others. Great post, thanks for sharing it with us and keep posting more such posts

    ReplyDelete
  2. These kind of issues usually happens with all the new devices. Its not because of some error but settings are sometimes different than the previos version which you need to explore.

    ReplyDelete
  3. The list displays thumbnail images of apps--instead of just icons--so you can see which part of the apps are currently working in the background.Visit website

    ReplyDelete
  4. You can utilize autonomous exchange discussions and audits to get the points of interest you require so you can affirm that what you are going to download is the right application or diversion.pop over here

    ReplyDelete
  5. I high welcome this post. It's elusive the great from the terrible here and there, yet I think you've nailed it! would you psyche upgrading your online journal with more data? App Valley

    ReplyDelete
  6. I love to enjoy walk in rain. You also like it very much. Coming site see more many blogs on instagram piknu

    ReplyDelete