Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with NativeScript

You're reading from   Getting Started with NativeScript Explore the possibility of building truly native, cross-platform mobile applications using your JavaScript skill—NativeScript!

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781785888656
Length 168 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Nathanael J. Anderson Nathanael J. Anderson
Author Profile Icon Nathanael J. Anderson
Nathanael J. Anderson
Arrow right icon
View More author details
Toc

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime