# Why is my app crashing? Help

**URL:** <https://community.thunkable.com/t/why-is-my-app-crashing-help/905105>\
**Category:** Questions about Thunkable X\
**Created:** [October 15, 2020, 5:24pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105 "2020-10-15T17:24:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![exploriverse.com](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/exploriverse.com/32/77609_2.png) [@exploriverse.com](https://community.thunkable.com/u/exploriverse.com)\
**Post date:** [October 15, 2020, 5:24pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/1 "2020-10-15T17:24:03Z")

</div>

My app crashes in any preview mode from these blocks, why?

What blocks am I using wrong? Thanks.

 ![Screen Shot 2020-10-15 at 10.27.14 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/a/ba256623d9be3bec2b86ccb875a37d5a8aef21e0.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 15, 2020, 5:56pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/2 "2020-10-15T17:56:22Z")

</div>

The only thing I notice is that you’re using text strings as integers (random integer from…).

That may work but if not, then you need to convert the strings by adding zero to each one (set stored Qstart to (get value from levels … + 0). I doubt that would actually crash your preview, though.

My other guess is that the row id value doesn’t match between the data viewer and the data source (levels).

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [October 15, 2020, 6:59pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/3 "2020-10-15T18:59:24Z")

</div>

If it is crashing on start up, the stored variables may not have any values. Referencing a variable without a value causes Thunkable to crash (guess how I know that…).

You might try checking for null when setting the label values, something like this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/3/934c53686fddf13b56a58a99d2c598531e0ade5d.png)

---

<div class="post-metadata">

**Author:** ![exploriverse.com](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/exploriverse.com/32/77609_2.png) [@exploriverse.com](https://community.thunkable.com/u/exploriverse.com)\
**Post date:** [October 16, 2020, 1:38pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/4 "2020-10-16T13:38:08Z")

</div>

Thanks, drted! Your advice is tremendous!

@drted Here is the troubleshooting, which you might be able to explain why it’s crashing, see below.

Just Navigate = No crash

 ![Screen Shot 2020-10-16 at 6.30.04 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/2/523a77569ba2d058821658ccfe50b8a06837f7d2.png)

Just Set var, get var = No crash

 ![Screen Shot 2020-10-16 at 6.30.16 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/2/523c24d382bbbdfd308ca16408c72c783fad04a5.png)

Set var, get var & Navigate = Crash

 ![Screen Shot 2020-10-16 at 6.30.25 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/6/b60caaaa814adff859e49ec65e05c3fba462a24c.png)

I do initialize all the variables or set them on the first screen, see last image.

 ![Screen Shot 2020-10-16 at 6.32.21 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/7/d7a04b204fb7343d91b55c26ff68f93c71ea5d63.png)

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [October 16, 2020, 2:01pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/5 "2020-10-16T14:01:17Z")

</div>

Great details, thanks!  
Here are a few more thoughts:

1.Have you tried adding a WAIT block between Get Value and Navigate to? I’ve found when getting data from external sources, WAIT blocks can make a big difference (I hate it, but it is true). I will typically start with a short wait (1 second) and then a LONG wait(10 seconds), just to see if Thunkable is struggling.  
2. What happens if you set just Qend and navigate? Just QStart and navigate?  
3. Does quiz 01 start or open events read or write to either QStart or QEnd?

Those are my thought, but I don’t have any silver bullets… ☹

---

<div class="post-metadata">

**Author:** ![exploriverse.com](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/exploriverse.com/32/77609_2.png) [@exploriverse.com](https://community.thunkable.com/u/exploriverse.com)\
**Post date:** [October 16, 2020, 2:56pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/6 "2020-10-16T14:56:06Z")

</div>

@drted Thanks again WAIT helps me see the vars code is working except in the scenario below.

I have pin pointed what circumstances are required for it crash.

It is when the following takes place (other scenarios it will work fine as mentioned in previous posts)

Including 2 get localdb blocks (1 will not crash)

 ![Screen Shot 2020-10-16 at 7.35.29 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/38499309bc594a95ef0cea69039319d3adc95db1.png)  
 ![Screen Shot 2020-10-16 at 7.35.39 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/c/ac0558db412430737db8efe5539a5dfab8b01a73.png)  
 ![Screen Shot 2020-10-16 at 7.35.46 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/f/cf83a042707721b8b19cc5031a70b2b1181ee978.png)

Navigate to the Quiz screen (won’t crash with 2 localdb & navigating to any other screen)

So the question is why would 2 get localdb and navigating to the quiz screen result in a crash?

For more color on what I’m doing on the quiz screen here are some screenshots of those blocks.

 ![Screen Shot 2020-10-16 at 7.54.14 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/1/b11974b9a7683ed19748267a1d1e0dc3576bb874.png) ![Screen Shot 2020-10-16 at 7.54.35 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/67f133d3a8dd4153b31a6ce7c09895890e49594b.png) ![Screen Shot 2020-10-16 at 7.54.25 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/b/3b2adf2f64b02ab927230022196d3e344c74c755.png)

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [October 16, 2020, 2:59pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/7 "2020-10-16T14:59:02Z")

</div>

I’ve had repetitive external data pulls cause errors. What happens if you put a long wait (10 seconds) between the Get Value blocks?

---

<div class="post-metadata">

**Author:** ![exploriverse.com](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/exploriverse.com/32/77609_2.png) [@exploriverse.com](https://community.thunkable.com/u/exploriverse.com)\
**Post date:** [October 16, 2020, 3:32pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/8 "2020-10-16T15:32:26Z")

</div>

Responses to your specific questions:

1. Putting in waiting makes no difference to the crash.
2. It does not crash see images above
3. Quiz 01 does not have any start where it “SETS” but it does “GET”. See images above of code on Quiz01 screen.

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [October 16, 2020, 3:40pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/9 "2020-10-16T15:40:42Z")

</div>

Dang it! 🤬

That about all the things I can think of. I gave up on real-time use of datasources because of issues like this.

What I do now is copy my data sources (google sheets) into Firebase and use Firebase to populate my app. [Data Source Performance Workaround FOUND!](http://community.thunkable.com/t/data-source-performance-workaround-found/756227)

Good luck and Happy Thunking!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 16, 2020, 6:07pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/10 "2020-10-16T18:07:39Z")

</div>

Just gonna link to this here 😉

> [@How to resize images & videos posted on the forums](http://community.thunkable.com/t/how-to-resize-images-on-the-forums/907937):
>
> It took me a while to realize I could do this so I’m sharing the method. When you drag an image from your computer into a new forum post window, you’ll see auto-generated text like this: In the preview on the right side of the window, you’ll see how large the image is (you might have to click the x to hide the related posts). To resize the image: Add a comma and percentage after the resolution values (e.g. ,50%):

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 16, 2020, 6:09pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/11 "2020-10-16T18:09:25Z")

</div>

Have you confirmed that the row IDs are the same for the data viewer list item and the local data source?

---

<div class="post-metadata">

**Author:** ![exploriverse.com](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/exploriverse.com/32/77609_2.png) [@exploriverse.com](https://community.thunkable.com/u/exploriverse.com)\
**Post date:** [October 17, 2020, 1:34am UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/12 "2020-10-17T01:34:46Z")

</div>

@drted Thank you for the recommendation. I was playing around with Firebase I just couldn’t figure out how to use it in thunkable. I will read your link and if I can learn it, then I’ll use Firebase.

@tatiang I know what a row ID is but choose to not use it because it was some long random number. Instead I made columns in the data viewer database that dictates what problems to load for the quiz. That is what Qstart and Qend vars are.

 ![Screen Shot 2020-10-16 at 6.30.57 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/6/1607d2fa0f9dca1b41c0e36b31eb7835cf50c34a.png)

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:22pm UTC](https://community.thunkable.com/t/why-is-my-app-crashing-help/905105/13 "2024-11-08T12:22:03Z")

</div>


