Skip to content

Reading External Storage does not work #41

@wamphlett

Description

@wamphlett

Reading external storage devices is not supported by this package.

Reproduce

Run the example app on a physical device and select an external device as the source. e.g. an SD card.

Error

Error: RangeError (length): Invalid value: Only valid value is 0: 1

Cause

The cause of the issue is a bad assumption that all directory paths include primary%3A. Specifically this line

String directoryPathUriString = uriString.split("primary%3A")[1];

External devices do not contain primary, instead they appear to contain a devide id so this is causing an invalid index. For example

"uri" -> "content://com.android.externalstorage.documents/tree/ABB8-7BD7%3APRIVATE%2FSONY"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions