Skip to content
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

Fix Failed to build unique file in Android #199

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

natsuk4ze
Copy link
Owner

@natsuk4ze natsuk4ze commented Jan 24, 2024

Fix: "Failed to build unique file" in Android

FileUtils.java only checks up to 31 times to generate a unique name, so it needs handling the "Failed to build unique file" error and generate unique names until it succeeds.

See: https://takusan.negitoro.dev/posts/android_unique_file/

Close #198

🗒️ Note
Suffix should be like image (32).jpg to match the Android system, But it was not possible because duplicate checking is done in the MediaStore system, so it would look like image (32)(1).jpg.

@natsuk4ze natsuk4ze merged commit 9e8d917 into main Jan 25, 2024
20 of 21 checks passed
@natsuk4ze natsuk4ze deleted the Fix-Failed-to-build-unique-file-in-Android branch January 25, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android: Failed to build unique file
1 participant