SimpleStorage: CANNOT_CREATE_FILE_IN_TARGET

If copying the same file to same destionation with

@Override
            public void onConflict(@NotNull DocumentFile destinationFile, @NotNull FileCallback.FileConflictAction action) {
                action.confirmResolution(ConflictResolution.REPLACE);
            }

the app tombstones Works only the first time…

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 76 (28 by maintainers)

Commits related to this issue

Most upvoted comments

Normal moveFileTo() uses renameTo() when possible, but it requires storage access. renameTo() can move 1GB file in a second when the source and target files are located in the same file partition.

0.5.3 has been released. Wait for several minutes until it is available on Maven.

Can you reproduce it? fm-sys/snapdrop-android#76

  1. send file from pc https://snapdrop.net/
  2. save in app
  3. go to filemanager
  4. delete file in downloads folder
  5. open app and send file again

apk https://github.com/fm-sys/snapdrop-android/suites/2613901505/artifacts/57251951

Did not happen after I add this check into MediaStoreCompat:

if (existingMedia?.openInputStream()?.use { it.available() == 0 } == true) {

Update your snapshots again. BTW, what’s your OS version?

I’ve found the root cause. The fixes will be on v0.5.3. I’ll release it this week.

Put your breakpoint here. Let’s see whether it is triggered:

image