App crash for no reason. Maybe data source with Google sheet?

Testing an app that I am making, and that used to work fine, now it closes the thunkable app when I open screen3.

Can anyone please tell me why?

Thank you

https://x.thunkable.com/cop

1 Like

Your app requires login info and would not be easy to check without access to the different databases you use (Firebase, Airtable) but I noticed that you use a lot of stored variable without testing if these variable actually assigned (have values) or not yet assigned (variables = null).

If you try to use a stored variable before giving it a value the app will crash so always use the if condition to make sure the stored variable you are using don NOT equal NULL.

1 Like

Hi Muneer and thanks for the reply.

So when a screen strats should I check if the stored variable is not null?

Could I solve by replacing the stored variable with the app variable?

Why does the app crash if I haven’t changed much?

Crash even older tests with fewer variables?

Thanks.

1 Like

Solved.

I followed your advice but above all I eliminated the web viewer I used to create qr codes.

It was the one, apparently, that crashed the app.

I have another question:
if I use the data source and load the coordinates on a sheet it works, when I ask the google sheet for the coordinates to put them on the map it crashes.

Can you help me?
Thank you

1 Like

It probably has to do with numbers vs. text. If you are getting text values (even if they are “121.36792” they are still formatted as text), then you need to convert them to numeric values by adding zero to the text strings.

2 Likes

Does not work :frowning:

I saw another thread here that gave the same tip, but it doesn’t work with + 0

1 Like

I don’t see any map/get location component in the screenshot.

Is it crashing in get value block?

It’s on the right side near the top of the screenshot.

@trawellit What happens if you change the app variable lat and app variable long to text blocks with sample lat/long values in them (plus zero)? Does the map correctly display then?

I’m trying to figure out if the problem is with your data or with your blocks. Your blocks look correct to me. How are you getting the green “row id” block? What event block is above the blocks in your screenshot?

1 Like

Thank you @tatiang
I wasn’t seeing it on my phone. I can see it now from the PC. Sign of old age.

yes. It upload data correctly and retrive data correctly unless coordinates

1 Like

Test the block by giving the coordinates (Latitude, Longitude) directly (You enter the values in the code) first and make sure it works. Then we can see if there is a problem with the variables.

What happens if you change the app variable lat and app variable long to text blocks with sample lat / long values ​​in them (plus zero)? Does the map correctly display then?

No, it crashes.

How are you getting the green “row id” block? What event block is above the blocks in your screenshot?

Data viewer list item click

I put some labels with the coordinates and they are correctly taken from the google sheet. The problem happens when I put these coordinates to create a point on the map

1 Like

I understand. This is why I want to eliminate the possibility of something wrong in the block.

So if you can type the numbers directly in the block in design time just to see that you will have a mark on the map. This way, we know nothing wrong with the block.

1 Like

@muneer

1 Like

Yes, I saw it. But I’d rather test the entering the numbers directly in the block itself rather than via the variable. Just my type of weird thinking.

Yes, I wrote essentially the same thing. Change the values to a text block. I was just pointing out that they responded “No, it crashes.” I wasn’t sure if you saw that.

2 Likes