Skip to content

getExternalStorageDirectories( ) returns empty string #106498

@aenckli

Description

@aenckli

Previously, getExternalStorageDirectories returns list of directories with empty (or null) parameter, and the first element is same as getExternalStorageDirectory. Now, getExternalStorageDirectories() returns empty string.

I found changes (#5959) recently in path_provider_android.dart as below,

  @override
  Future<List<String>?> getExternalStoragePaths({
    StorageDirectory? type,
  }) async {

//////////// removed below return statement ////////////////
    return methodChannel.invokeListMethod<String>(
      'getExternalStorageDirectories',
      <String, dynamic>{'type': type?.index},
    );

//////////// added below return statement ////////////////
    return type == null
        ? <String>[]
        : (await _api.getExternalStoragePaths(_convertStorageDirectory(type)))
            .cast<String>();
  }

is this the cause of the issue ? Is there any workaround to get the list of directories as before?

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is nowp: path_providerPlugin that provides resolved paths to some platform directoriespackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions