Skip to content

[Android] PlatformFile.parent() produces invalid URI and crashes with "Uri is not a directory" #655

Description

@luuimora

When trying to access parent directory on Android, I'm getting crash with this log message:

FATAL EXCEPTION: main
io.github.vinceglb.filekit.exceptions.FileKitException: Uri is not a directory: content://com.android.externalstorage.documents/tree/primary%3ADocuments/document/primary%3ADocuments

The context of use is:

fun dirLevelUp() {
        currentDir.value = currentDir.value?.parent()
    }

Steps to Reproduce:

Pick a directory using FileKit.openDirectoryPicker().

Access a subdirectory or document, then attempt to navigate back up using currentDir.parent().

Try to list files of the returned parent directory.

Sorry if something is off, I place an issue for the first time. Thanks for your work, I enjoy using your lib!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nextScheduled for the next version

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions