JSON file loads in Preview but not in Android APK

Describe the bug

Hi!

I’m using the action “Read JSON file into scene variable”.

Everything works correctly in Windows Preview.

But after exporting to Android APK:

  • the JSON file is in Resources;

  • “Wait until the action is complete” is enabled;

  • the scene variable is an empty structure before loading;

  • VariableChildCount(DialogueFromJson.stories) works in Preview (returns 24), but on Android it doesn’t.

I also tried waiting 1 second after loading, but it didn’t help.

Is this a known issue or am I missing something?

Steps to reproduce

  • Create a project.

  • Add a JSON file to Resources.

  • Read it into a scene Structure variable.

  • Export to Android APK.

  • Launch the APK.

  • The JSON is not loaded, while it works in Windows Preview.

Share a very simple GDevelop project showing the bug

“preLevel1.json”

{
“stories”: [
“Hello”,
“Second line”
],
“reactions”: ,
“lessons”:
}

You could try the “JSON Resource Loading” extension.

Thank you for your reply! :slightly_smiling_face:

This is another example using the same action.

Sorry that my GDevelop interface is in Ukrainian. I hope the screenshots and the attached project are still clear enough to understand the problem.

If anything is unclear, I’ll be happy to explain or translate the events into English. :blush:

With my screenshot I wanted to say that none of the built-in File system actions work with Android.
But you can try the extension, I suspect it exists to remove that limitation and also work on Android.

For some reason, the search doesn’t show me experimental versions, and I can’t install them through the author’s page…:melting_face:

:smiling_face: Thanks a lot, now the file is read on both Windows and Android, and that bug I wrote about earlier didn’t read the file even if exported for desktop. With this extension, it got better.

For next time, if possible, please start with the “How do I” section instead of the “Bug” section. Most of the time, the issue can be solved, and it doesn’t necessarily have to be a bug.

it doesnt explain why it wasnt working on android though.
oh my bad nvm