Saving/Loading Storage on Android

Hi all,
I searched within the forum for a possible solution to my issue, but alas I did not understand what I am doing wrong. I am developing a very simple game, planning on using it on an Android smartphone, and all is working good but the access to the storage. Basically, I just want to save a variable at the end of the game so that when the game is closed and open again the variable keeps that value, sort of “remembering” that the game was already finished at least once.
Here’s the code that I am using:

However, when I close the app on the smartphone and reopen it, it looks like the storage is not accessible or that the variable has not been loaded successfully.

On a side note, the code seems to work well when using the preview on the PC, as when closing and reopening gDevelop the variable is correctly loaded everytime.

Maybe I am missing something obvious, but I am trying to find a solution for a few days now with no luck. Thanks in advance for the help!

Welcome here!
You don’t show what you’re trying to do with that variable.
Sometimes, it’s a matter of event order, making sure you’re not overwriting the value before reading it. :person_shrugging:
Feel free to try the save-load example project on your phone, to confirm that the storage feature works as expected.

Hi Gruk, thank you for your response!
The variable is a simple string that is saved at the end of the game (i.e., if the game was finished once, set the variable to 1) and then, when the game is closed and opened, there is a condition that check if the variable stored is equal to 1 to delete an object, like this:

It could be that I am overwriting the variable somewhere, but I don’t get why on the preview the storage seems to work fine.
Thanks also for the insight on exporting the save-load example to Android to check if it’s working properly, I’ll do that and I’ll update you eventually if something is wrong.