Cant load config file on Android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kubaxius
:warning: Old Version Published before Godot 3 was released.

As the title say, I can not load cfg file via ConfigFile class. Everything works fine on Windows, but when I export game for Android it throws an ERR_CANT_OPEN error. I tried to load this file via File class and it doesn’t work too, but this time error code equaled 3, ERR_UNCONFIGURED.

Sorry for any language mistakes, but I’m not native.

Is it a custom config file in your project folder? If so, export with the “Export all files” option, or make sure to whitelist this file (or all *.cfg files), otherwise it might not be exported (and thus it runs fine in the editor which uses the normal project folder, but not with the exported data pack).

Akien | 2017-06-16 07:35

Thanks, that was it :slight_smile:

kubaxius | 2017-06-16 09:27

Great, I’ll turn my comment into an answer then.

Akien | 2017-06-16 09:28

:bust_in_silhouette: Reply From: Akien

When you export your game, you have several possibilities to define what files should be exported.

By default, only resources (i.e. files that Godot knows are necessary since they are loaded by scenes) are exported, which means that if you load a text or config file from code, it won’t be exported.

You can fix that by selecting the “Export all files” option, or by whitelisting the specific files or file types you want to include in the data pack.

:bust_in_silhouette: Reply From: Amigoimaginario

380/5000
I faced this problem too, so I stuck a lot until I did the following.
1- Change file directory to user: //
2-Copy and paste your cfg file where is your project in “user”, how to find? just go to C: \ Users \ Lara \ AppData \ Roaming \ Godot \ app_userdata \ ProjectName
3-Go to on Export >>> Resource >>> Filters to export non-resource files: type * .cfg
Ready :3