"ERROR: root_subfolder must be an existing sub-directory" in build

Godot Version

4.3

Question

Running the build of my project results in the error

ERROR: root_subfolder must be an existing sub-directory.
   at: (scene/gui/file_dialog.cpp:903)

Does anyone know what it means or what I can do to fix it? Thanks :slight_smile:

1 Like

It means that your root_subfolder is not being found. You should check the folder exists first in code before trying to write or read from it.

Commonly, this is when you construct a path in code, but one of the elements is wrong, perhaps uppercase/lowercase issue, or prehaps a missing slash etc. Sometimes it is just a typo. Should be easy enough to spot and fix.

Hope that helps.

Thank you,
The thing is the errors don’t appear when running the project from within the editor and everything in the game works as expected.
I also couldn’t find any mistakes in the paths I am using…

Oh I see.

Could you have used capitals in your folder names, or spaces perhaps? This can cause platform dependent issues sometimes. Other than that I don’t know what to suggest, sorry.

I hope someone else has some ideas for you and that you get it fixed soon.

Oh I’m really sorry, it was actually because of a file path, more specifically the root_subfolder property of a FileDialog. Apparently it can’t see the directory I was referencing in the build version (for some reason).
I’ve temporarily ‘fixed’ the issue by just leaving the path empty and switching to the native file dialog so the user can access the directory…

1 Like