
Try to isolate or reduce the code surrounding the issue and figure out the simplest way to reproduce what’s occurring. Before assuming the code is broken, try restarting the emulator, trying the app on a device and/or fully re-building the app. Convince yourself that there is an issue in the code that can be repeatedly reproduced by following the same steps. The following high-level principles should be applied when faced with an unexpected app behavior during investigation: This is entirely normal as a mobile engineer. Often you may find yourself on some days spending more time debugging crashes or unexpected behavior then writing new code. Debugging is a vital part of the software development process.Debugging is an opportunity to understand your app better than you did before and hopefully sharpen your ability to write correct code in the future by programming defensively.


Debugging MindsetĪs an Android developer, you'll need to cultivate a "debugging mindset" as well as build up defensive programming practices that make writing error-prone code less likely. Refer to our guide below and/or these debugging slides for more a detailed look at debugging crashes and investigating unexpected problems with your app. You know you have experienced a runtime exception when you see this in your emulator or device:ĭon't worry though! This is totally normal and there's a specific set of steps you can take to solve these.

When building Android apps, your app is bound to crash from time to time or exhibit strange unexpected behavior.
