I recently trimmed down the code blocks on my mobile app. There were some redundant things (lists mostly) that I don’t need now that I understand better how Thunkable works. It works perfectly on the Thunkable Mobile test app. All screens work, logic is clean, nothing is broken.
However, when I download the APK to test on my Android, things change. The app opens as it should, and all screens - except one - work. It is a progress tracker screen. If there is no progress triggers activated when I tap on the “Progress” screen then the app goes back to the Thunkable splash screen and gets stuck. However, if I do a task that I know awards progress, the app no longer crashes when I go to the “Progress” screen. I’m not sure how to diagnose this - other than adding back the redundant code… which I would really rather not do. It’s just bloated with it. I’ll post a Google Drive link to a video I grabbed of it in action:
Any ideas how to diagnose it, solve it, or trouble shoot it would be helpful.
I can see you use stored variable. Remember that stored variables when initialized holds the value of null so before using them make sure you set them up or better to check your stored variable at the start of your app and whichever is equals to null reset it to the value that fits your app.
Most probably your app works in Live Test because the stored variable is not null but when you installed the APK all stored variables are rested back to null which caused this behavior.
Thank you! I’m going to play around with it today and see if I can figure out a logic so that the stored value doesn’t get reset each time the app loads. Would I be better off using an App Variable instead of using a Stored Variable? I’m going to try it anyways and see how it works; but if you have a better way of using variables, I’m all ears!
Even if this isn’t my problem, I really appreciate the detailed and clear answer. It helps me a lot.
The use if any type of variable is related to the use case you are considering.
An App variable holds data as long as the app is running and once the app is closed, it loses the data and reinitialized the next time the app runs.
A Stored variable, as its name implies, stores the value of it even after the app is closed. This variable is initialized as null the first time the app runs and there are a number of functions or components that does not like nulls to be passed to them. You need to check if this variable holds data before trying to assign it to another component. It should be noted that stored variables are stored in the user’s device and can only be accessed by the app created them.
A Cloud variable again from the name it refers to values saved in a cloud storage. When ever this variable is updated the cloud storage is also updated and other apps could see the update.