diff --git a/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart index f26f88b465..9a4a5d6b21 100644 --- a/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart @@ -117,6 +117,13 @@ void _verifySampleFile(Directory? directory, String name) { file.writeAsStringSync('Hello world!'); expect(file.readAsStringSync(), 'Hello world!'); - expect(directory.listSync(), isNotEmpty); + // This check intentionally avoids using Directory.listSync on Android due to + // https://github.com/dart-lang/sdk/issues/54287. + if (Platform.isAndroid) { + expect( + Process.runSync('ls', [directory.path]).stdout, contains(name)); + } else { + expect(directory.listSync(), isNotEmpty); + } file.deleteSync(); } diff --git a/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart index e48cdf1796..104a7e1aaf 100644 --- a/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart @@ -101,6 +101,9 @@ void _verifySampleFile(String? directoryPath, String name) { file.writeAsStringSync('Hello world!'); expect(file.readAsStringSync(), 'Hello world!'); - expect(directory.listSync(), isNotEmpty); + // This check intentionally avoids using Directory.listSync due to + // https://github.com/dart-lang/sdk/issues/54287. + expect( + Process.runSync('ls', [directory.path]).stdout, contains(name)); file.deleteSync(); }