Resource not found in exported build despite valid res:// path
0 reputation · 30 Nov 2024, 18:09 UTC
A Godot project functions correctly within the editor on Windows and macOS but fails with a 'Resource not found' error when exported to Linux or Android. This discrepancy occurs when resource paths defined via the res:// prefix use casing that does not strictly match the actual filename on disk.
While the local development environment often utilizes a case-insensitive filesystem, the production build on Unix-based platforms enforces strict case matching. This is particularly problematic when resources are loaded dynamically via @export variables or load() calls, as the editor may resolve the path regardless of casing mismatches, while the exported virtual file system fails to locate the asset within the compressed .pck file.
How can I programmatically validate path case-sensitivity during the project export process to prevent these runtime crashes? Are there specific export filters or editor tools that can flag casing mismatches before the build is finalized?