Screen shows 1 sec and then becomes blank

Hello, I have been with a problem for a while and I can not solve it and the support team have not helped me. I also searched the community and there are many problems with blank screens but none similar to the one I have, I hope you can help me.

The problem I have is that the home screen sometimes loads and sometimes does not. In my app there is the option that allows you to skip the login to navigate within the app without registering. In this case, the home screen displays fine, with no errors

WhatsApp Video 2021-07-23 at 1.26.27 PM

But the problem comes when logging in, once your authentication is correct, it sends you to a screen where you must choose a branch, once you choose it, it sends you to the home screen. The problem is that when you choose the branch and open the home screen, it shows the content of the home screen for 1 second and suddenly goes blank.

WhatsApp Video 2021-07-23 at 1.25.37 PM

It may seem that the problem is in the branch screen, but in reality this screen only has a data viewer where you must select a branch for the app to do a distance calculation and save it in a variable, after this, open the home screen, but that’s when the problem happens.

I attach screenshots of the branch screen blocks, as you can see, it only do calculations, change the value of a variable and just open the home screen

Thanks to all

2 Likes

This is the first clue that thing are probably ok on the home screen…

This would suggest that there’s an error in your block, in the part where you’re doing the calculation.

Thanks for the screenshot - I can see that you’re trying to get 200 rows, but the limit is actually 100 rows (which is set by Airtable for all users, independent of Thunkable)

Making an invalid call like this will cause your app to crash.

This is a case of user error, rather than a Thunkable error as you have initially suggested.


This is a very unfair remark to make - all 5 questions you asked in the past 5 weeks were answered by a member of the team. You closed 4 of them and didn’t respond to our questions on the 5th. Please take care what you post in the Community.

Thanks

3 Likes

Blockquote
This is a very unfair remark to make - all 5 questions you asked in the past 5 weeks were answered by a member of the team. You closed 4 of them and didn’t respond to our questions on the 5th. Please take care what you post in the Community.

First of all, sorry if it sounded too hard, my English is not that good, I meant that I could not solve the problem with the help team. And I sent 5 chats because the response time was sometimes several days. In the end I did not answer because my membership expired and the chat disable

Blockquote
This would suggest that there’s an error in your block, in the part where you’re doing the calculation.

I am sure this is working correctly, i only use math blocks to get a number and compare with another.

Blockquote
I can see that you’re trying to get 200 rows

I didn´t know that, i wil try it and coment what happens
Thank you so much

UPDATE:

The app still crashes, I´ve verified the formula for distance calculation (Haversine formula) and is ok, I´ll try to move the function to another screen

I’ve used Haversine. It’s very tricky to get the right answer but it shouldn’t crash your app unless you’re dividing by zero or something like that.

Try debugging by adding Wait blocks and changing label values to highlight where in the code you’ve reached right before it crashes. This is my process: Debugging in Thunkable X (Video).

2 Likes

Do you think that the error shows when you dont allow location access? Like if deny access gives a 0 that is being divided?. Anyway I will check that post

Thanks!

I´ve been checking. I realized that the error is on the login screen. If you log in, the home screen shows it blank. But if you skip the login it loads normal. But this problem just happen on iOS, on Android works fine. Any idea?

I attach some screenshots:

This is the code for the skip logging in button. This just fills variables and navigate to another screen (This is working fine)

1

And this is the code for the log in button. As you can see, first read firebase database to check the user info (and hide some components), then fills the same variables but using firebase data, and then navigate to another screen (This is not working)

1 Like

Are you using the variable “UsuarioNombre” in anything in the next screen?

You are trying to get the value in this variable asynchronously so it could fail.

Yes. Im using that variable on the next screen, same as other variables UsuarioXXXXX but as I said, when use the skip log in button, fills the same variable that use on the next screen/s. But my head breaker now is why on Android works normally

UPDATE: The app still crashing, I´ve tested on many iPhones. I’ve moved the branch screen and still crashing so i don’t think it´s this the cause. On many iPhones the app crashes, on some of them not. I´m thinking that is a bug on the Thunkable Platform because of this. I attach 2 screenshots of the same version on the app running on 2 different iPhones:

iPhone 7: The app runs correctly, log in working fine
WhatsApp Video 2021-07-27 at 2.06.59 PM

iPhone 11: The app crashes when you log in, as you can see, before set blank screen you can see the home screen for a second
WhatsApp Video 2021-07-27 at 2.05.34 PM

Here is the link of my project if someone want to check the involved screens are “BIENVENIDO” and “INICIO”
https://x.thunkable.com/projects/5f5263d2612ab8d640b02917/5bd1119f-9f17-4023-a92a-2072eba2765c/designer

1 Like