Skip to content

Android: Fix save issue when using native file dialog #107207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

syntaxerror247
Copy link
Member

@syntaxerror247 syntaxerror247 commented Jun 6, 2025

Fixes the issue where saving a file without MANAGE_EXTERNAL_STORAGE permission using the native file dialog to get the file path causes the ERR_FILE_NOT_FOUND error.


A blank file gets created by default when using the save dialog, which isn't available to the Godot app without required permission (MANAGE_EXTERNAL_STORAGE) and when trying to access that file using FileAccess(mediastore api) with the path returned by FileDialog, results in ERR_FILE_NOT_FOUND error (as shown in the linked issue description).
There's no way to stop this blank file creation, so this PR immediately deletes the blank file instead.

This change also brings Android's behavior in line with desktop platforms, where no blank file is created when saving using the native file dialog.

Fixes #107206

Fixes the issue where saving a file without `MANAGE_EXTERNAL_STORAGE` permission using the `native file dialog` to get the file path causes the `ERR_FILE_NOT_FOUND` error.
@syntaxerror247 syntaxerror247 requested a review from a team as a code owner June 6, 2025 10:39
@syntaxerror247 syntaxerror247 added this to the 4.5 milestone Jun 6, 2025
@syntaxerror247 syntaxerror247 added the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Jun 6, 2025
@akien-mga akien-mga merged commit 6e5bcd2 into godotengine:master Jun 10, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@syntaxerror247 syntaxerror247 deleted the filePicker-save branch June 10, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release platform:android topic:porting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File save issue using the native file dialog on Android
3 participants