# Critical Error - can't find problem

**URL:** https://community.thunkable.com/t/critical-error-cant-find-problem/2454525
**Category:** Questions about Thunkable X
**Created:** [June 6, 2023, 7:32pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525 "2023-06-06T19:32:40Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 6, 2023, 7:32pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/1 "2023-06-06T19:32:40Z")

</div>

I am getting a critical error now on the live test on mobile, when before it was working without issue. When I click the button, instead of it completing the action, I get the error screen. On the web, it works just fine.

The error showed after I added blocks to the screen for another component. I removed them, and the error persists.

Attached are screenshots of the blocks in question, which I have not changed from when they were working.

Can someone help me figure out how to fix this please?

![Screen Shot 2023-06-06 at 2.26.53 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/1530bc84ad882ecdbc607307302e5a263548a6ef.png)

 ![Screen Shot 2023-06-06 at 2.27.06 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/8/a8254f523c589195a6ecd08a6dd85be4f65ce750.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: [June 6, 2023, 10:41pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/2 "2023-06-06T22:41:45Z")

</div>

Just a side note that you don’t have to check app variables for null values. That’s only something you need to do for stored variables. You could probably simplify that code quite a bit…

But in terms of finding the source of the crash, I’d recommend doing some block-by-block debugging. I have a method I use that works pretty well: [Debugging in Thunkable X (Video)](https://community.thunkable.com/t/debugging-in-thunkable-x-video/849471)

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 6, 2023, 10:43pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/3 "2023-06-06T22:43:50Z")

</div>

As for the “null”, I found it during my searches on the site and it worked, so I used it. Lol. What would you suggest to do to simplify it? I’m all for less coding to mess up.

I’ll take a look at the debugging info now, thanks 🙂

---

<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: [June 6, 2023, 11:16pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/4 "2023-06-06T23:16:25Z")

</div>

Sure, I can suggest some improvements. If possible, post a link to your project so I can modify your blocks to show you.

Also, what is the purpose of that code? Are you trying to swap background colors?

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 7, 2023, 8:42pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/5 "2023-06-07T20:42:47Z")

</div>

I’m not sure how to share my project, as it’s private - I’ll try a link. [Thunkable](https://x.thunkable.com/projects/6222a5ad5ab24d0011af7df2/2034331e-8e6b-456e-83d6-2fa4042d75ba/designer)

Yes, it’s a drop down list, and the selected item changes colour and gets pushed to the button’s text.

---

<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: [June 7, 2023, 10:27pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/6 "2023-06-07T22:27:29Z")

</div>

I’m not able to open that, possible because it’s a private project.

But one change I would make is that when the user clicks an item, you just set the Layout Wrapper’s Background Color to a color value (either via a variable or the Layout Wrapper’s Background Color block).

You can probably do that without variables and definitely without “if” blocks.

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 8, 2023, 2:34am UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/7 "2023-06-08T02:34:54Z")

</div>

I went through the blocks and reduced what was there by getting rid of variables, etc. It works as intended, but there is one new issue. When you click the item in the list, it changes colour, and sends the text to the button. If you click the button again, it now returns the list and the first item is still highlighted, and it will highlight the next button you click as well. I want only one to be able to be highlighted at a time.

As for the mobile app, I am still getting the critical error message with these new changes. I have attached a SS of the revamped blocks.

 ![Screen Shot 2023-06-07 at 9.29.07 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/6/864ffbf0e3f5919f8e6f4dec83550c3c75de4cf2.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: [June 8, 2023, 3:38am UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/8 "2023-06-08T03:38:57Z")

</div>

That looks much better!

You’re going to need to loop through all of the rows and set the background color based on whether or not the row is matches the one the user clicked. It’s not the easiest thing to set up and it requires using the Any Component blocks.

I’ll see if I can find an example for you on the forums.

**Edit:** this is a good example that you can tweak for your needs: [Cloud based To Do list, part 1](https://community.thunkable.com/t/cloud-based-to-do-list-part-1/418469)

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 8, 2023, 6:50pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/9 "2023-06-08T18:50:11Z")

</div>

I was able to get the button to work properly by adding a few blocks at the end, but I didn’t use the Any Component blocks. Would this cause problems? Would you mind taking a look at it? The first button works as expected, but the 2nd button, same type of blocks, does not change colour and change the text of the button.

I am still stuck on the critical error on mobile. Removing the extra blocks had no effect like I had hoped.

I’m off to check out the Cloud example you posted. Thank you 🙂  
(EDIT: the Cloud example link has expired)

---

<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: [June 8, 2023, 7:26pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/10 "2023-06-08T19:26:02Z")

</div>

I didn’t check the link in that topic but the screenshots should be helpful.

If you made changes to your project, you’ll need to post a new link. Each link is a snapshot of the state of that project at the time the link was created.

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 8, 2023, 8:50pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/11 "2023-06-08T20:50:15Z")

</div>

I did read through the page and screenshots, just thought I’d give a heads-up on the link.

I made a copy of the private project page that has the critical error issue on mobile. I don’t have all the components on this screen yet, but it does give the error message when the Strain or Product buttons are pressed. The Product button is the one that isn’t working properly yet (colour change and text push)  
[https://x.thunkable.com/projects/6482218b8e8991da8f8e487d/85bf2d28-3119-467d-b39d-075797f28730/designer](https://x.thunkable.com/projects/6482218b8e8991da8f8e487d/85bf2d28-3119-467d-b39d-075797f28730/designer)

---

<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: [June 8, 2023, 11:10pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/12 "2023-06-08T23:10:49Z")

</div>

It’s not crashing for me on an iPhone. What device are you using? And at what point does it crash?

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 9, 2023, 12:25am UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/13 "2023-06-09T00:25:33Z")

</div>

I’m using a Pixel 5. The app and the screen open fine. I can click anything except the Strain or Product buttons. Click either of those, and it gives the critical error.

EDIT: I have cleared the app’s cache, and restarted my phone, in an attempt to get it to work.  
I have attached a screenshot of the error I get when I click the Strain button.

 ![Screenshot_20230608-193608](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/b/7b9bbfd4017c4bb9e5b3f7e6bbaa45717bb53013.jpeg)

EDIT: I tested on a Galaxy S8+ and same result. Boo.

---

<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: [June 9, 2023, 1:02am UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/14 "2023-06-09T01:02:01Z")

</div>

Hmm. I think that’s going to be something you need Thunkable Staff support for.

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 12, 2023, 7:11pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/15 "2023-06-12T19:11:11Z")

</div>

I made a copy of the private app so that I can post it for your review. It works fine on web, crashes on my mobile (Pixel 5 and Samsung Galaxy S8+).

The screen in question is the NEW\_STRAIN\_PAGE. The STRAIN and PRODUCT buttons are the buttons that create the critical error message on mobile.

I have the blocks set up for most of the page, but am hung up on trying to make sure that the app works so far on web and mobile. I am hopeful that you can help me figure out where I went wrong. [Thunkable](https://x.thunkable.com/projects/648767966a4f98bc3b9dddcb/2034331e-8e6b-456e-83d6-2fa4042d75ba/blocks)

---

<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: [June 20, 2023, 6:21pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/16 "2023-06-20T18:21:00Z")

</div>

Hello @kcmahlo  
I checked your app  
It seems the issue is related to the custom Data viewer layout you are using on the DVLs  
I used another Layout and everything worked fine.  
Try to do the same and let me know if it helped

---

<div class="post-metadata">

### Author: ![kcmahlo](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kcmahlo](https://community.thunkable.com/u/kcmahlo)
#### Post date: [June 20, 2023, 8:07pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/17 "2023-06-20T20:07:08Z")

</div>

I’m not sure what you mean by Layout for the DVL. I ended up switching to a Simple List, and it works now. Did you mean something different?

Thank you @ioannis for taking the time to look over my project to help find where it went buggy. 🙂

---

<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: [June 22, 2023, 3:58pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/18 "2023-06-22T15:58:17Z")

</div>

@kcmahlo Glad that it is working for you now  
This is the Data viewer layout:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/2/3249fe4967569347b89287af17d5b05076921440.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [September 20, 2023, 3:58pm UTC](https://community.thunkable.com/t/critical-error-cant-find-problem/2454525/19 "2023-09-20T15:58:39Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
