Understanding the call stack
We will switch tracks. The other side of the equation is debugging your application when it breaks. Nobody is perfect at coding, so understanding the call stack is an important factor in figuring out why your application has just crashed. Both Android and iOS report the call stack slightly differently. So, we shall examine Android first and then finish up with iOS call stack. So, open up your main-page.js
file, and on line three, add the bogus code: Stock.blah();
.
Android call stack
On Android, you get the call stack in two different places. When the application crashes, it normally creates a log in the actual application that you can view and it looks like this:
As you can see, about half way down on the screen, in the error report, there is the actual error. The error is TypeError: cannot read property 'blah' of undefined. In this case, I put it on line 3, column 6. In this case, the error actually points to the issue directly. Sometimes, you get lucky, and the...