Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CANNOT_CREATE_FILE_IN_TARGET when attempting to save on external drive

Open
#106 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, kotlin
Domain
mobile-dev

Research direction

Start by locating and reading DocumentFileUtils.moveFileTo, then reproduce the reported failure using a folder selected with ACTION_OPEN_DOCUMENT_TREE on an external drive. Compare with a move to an internal folder and check whether the external target is readable and writable. Done when moving to the external folder succeeds or the operation reports the underlying failure clearly.

Written by the indexing model from the issue text.

Description

enhancement

Library version: 1.5.1
OS version: [Android 11]
Device model: [Samsung Galaxy A8]

Describe the bug
When invoking DocumentFileUtils.MoveFileTo targeting a folder stored on an external drive (USB SSD in my example) the movement fails.

If the target folder is an internal folder, the move succeeds

Full file permission has been granted, the external folder has been selected using OPEN_DOCUMENT_TREE

To Reproduce

  1. give application full file permissions

  2. select target folder using ACTION_OPEN_DOCUMENT_TREE

  3. select file that will be moved

  4. start background thread

  5. check file can be read and location can be written to

DocumentFileUtils.moveFileTo([any file], this, [Folder on external drive], null, new FileCallBack(){}

Stacktrace
[If applicable]

Dominant language
Kotlin
Stars
867
Forks
103
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anggrayudi/SimpleStorage

All issues in anggrayudi/SimpleStorage

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.