Skip to content

[path_provider] Migrate off getExternalStorageDirectory #35299

@amirh

Description

@amirh

getExternalStorageDirectory is deprecated and is returning an invalid path when the app is targeting Android Q. The deprecation notice:

This method was deprecated in API level 29.
To improve user privacy, direct access to shared/external storage devices is deprecated. When an app targets Build.VERSION_CODES.Q, the path returned from this method is no longer directly accessible to apps. Apps can continue to access content stored on shared/external storage by migrating to alternatives such as Context#getExternalFilesDir(String), MediaStore, or Intent#ACTION_OPEN_DOCUMENT.

This method is currently used by the path_provider plugin (code).

We should migrate the plugin off this method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p: path_providerPlugin that provides resolved paths to some platform directoriespackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions