diff --git a/.ci.yaml b/.ci.yaml index 868d82d387d..293c934fa96 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -25,7 +25,7 @@ platform_properties: device_type: none dependencies: >- [ - {"dependency": "android_sdk", "version": "version:33v6"}, + {"dependency": "android_sdk", "version": "version:34v1"}, {"dependency": "open_jdk", "version": "version:17"}, {"dependency": "curl", "version": "version:7.64.0"} ] @@ -250,7 +250,7 @@ targets: # web_benchmarks needs Chrome. dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"}, + {"dependency": "android_virtual_device", "version": "34"}, {"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"}, {"dependency": "chrome_and_driver", "version": "version:114.0"} ] @@ -267,7 +267,7 @@ targets: # See comments on 'master' version above. dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"}, + {"dependency": "android_virtual_device", "version": "34"}, {"dependency": "clang", "version": "git_revision:5d5aba78dbbee75508f01bcaa69aedb2ab79065a"}, {"dependency": "chrome_and_driver", "version": "version:114.0"} ] @@ -302,6 +302,8 @@ targets: {"dependency": "open_jdk", "version": "version:11"} ] + # All of the Linux_android android_platform_tests shards have the same + # dependency list, despite some running on Android 33 AVDs versus 34. - name: Linux_android android_platform_tests_shard_1 master recipe: packages/packages timeout: 60 @@ -309,10 +311,11 @@ targets: target_file: android_platform_tests.yaml channel: master version_file: flutter_master.version + # set up for 34 package_sharding: "--shardIndex 0 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_2 master @@ -322,10 +325,11 @@ targets: target_file: android_platform_tests.yaml channel: master version_file: flutter_master.version + # set up for 34 package_sharding: "--shardIndex 1 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_3 master @@ -335,10 +339,11 @@ targets: target_file: android_platform_tests.yaml channel: master version_file: flutter_master.version + # set up for 34 package_sharding: "--shardIndex 2 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_4 master @@ -348,10 +353,11 @@ targets: target_file: android_platform_tests.yaml channel: master version_file: flutter_master.version + # set up for 34 package_sharding: "--shardIndex 3 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_5 master @@ -361,10 +367,11 @@ targets: target_file: android_platform_tests.yaml channel: master version_file: flutter_master.version + # set up for 34 package_sharding: "--shardIndex 4 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_6 master @@ -374,10 +381,11 @@ targets: target_file: android_platform_tests.yaml channel: master version_file: flutter_master.version + # set up for 34 package_sharding: "--shardIndex 5 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_api_33_shard_1 master @@ -388,6 +396,7 @@ targets: target_file: android_platform_tests_api_33.yaml channel: master version_file: flutter_master.version + # set up for 33 package_sharding: "--shardIndex 0 --shardCount 2" dependencies: >- [ @@ -402,6 +411,7 @@ targets: target_file: android_platform_tests_api_33.yaml channel: master version_file: flutter_master.version + # set up for 33 package_sharding: "--shardIndex 1 --shardCount 2" dependencies: >- [ @@ -419,7 +429,7 @@ targets: package_sharding: "--shardIndex 0 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_2 stable @@ -433,7 +443,7 @@ targets: package_sharding: "--shardIndex 1 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_3 stable @@ -447,7 +457,7 @@ targets: package_sharding: "--shardIndex 2 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_4 stable @@ -461,7 +471,7 @@ targets: package_sharding: "--shardIndex 3 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_5 stable @@ -475,7 +485,7 @@ targets: package_sharding: "--shardIndex 4 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_shard_6 stable @@ -489,7 +499,7 @@ targets: package_sharding: "--shardIndex 5 --shardCount 6" dependencies: >- [ - {"dependency": "android_virtual_device", "version": "33"} + {"dependency": "android_virtual_device", "version": "34"} ] - name: Linux_android android_platform_tests_api_33_shard_1 stable diff --git a/.ci/targets/android_platform_tests.yaml b/.ci/targets/android_platform_tests.yaml index eea5063cb71..7e27f17d581 100644 --- a/.ci/targets/android_platform_tests.yaml +++ b/.ci/targets/android_platform_tests.yaml @@ -5,23 +5,23 @@ tasks: - name: download Dart and Android deps script: script/tool_runner.sh infra_step: true - args: ["fetch-deps", "--android", "--supporting-target-platforms-only"] + args: ["fetch-deps", "--android", "--supporting-target-platforms-only", "--exclude=script/configs/still_requires_api_33_avd.yaml"] - name: build examples script: script/tool_runner.sh - args: ["build-examples", "--apk"] + args: ["build-examples", "--apk", "--exclude=script/configs/still_requires_api_33_avd.yaml"] - name: lint script: script/tool_runner.sh - args: ["lint-android"] + args: ["lint-android", "--exclude=script/configs/still_requires_api_33_avd.yaml"] # Native unit and native integration are split into two steps to allow for # different exclusions. # TODO(stuartmorgan): Eliminate the native unit test exclusion, and combine # these steps. - name: native unit tests script: script/tool_runner.sh - args: ["native-test", "--android", "--no-integration", "--exclude=script/configs/exclude_native_unit_android.yaml"] + args: ["native-test", "--android", "--no-integration", "--exclude=script/configs/exclude_native_unit_android.yaml,script/configs/still_requires_api_33_avd.yaml"] - name: native integration tests script: script/tool_runner.sh - args: ["native-test", "--android", "--no-unit"] + args: ["native-test", "--android", "--no-unit", "--exclude=script/configs/still_requires_api_33_avd.yaml"] - name: drive examples script: script/tool_runner.sh - args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android.yaml,script/configs/exclude_integration_android_emulator.yaml"] + args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android.yaml,script/configs/exclude_integration_android_emulator.yaml,script/configs/still_requires_api_33_avd.yaml"] 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 f26f88b4652..d540f0e65de 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 @@ -36,14 +36,14 @@ void main() { _verifySampleFile(result, 'library'); } else if (Platform.isAndroid) { final Future result = getLibraryDirectory(); - await expectLater(result, throwsA(isInstanceOf())); + expect(result, throwsA(isInstanceOf())); } }); testWidgets('getExternalStorageDirectory', (WidgetTester tester) async { if (Platform.isIOS) { final Future result = getExternalStorageDirectory(); - await expectLater(result, throwsA(isInstanceOf())); + expect(result, throwsA(isInstanceOf())); } else if (Platform.isAndroid) { final Directory? result = await getExternalStorageDirectory(); _verifySampleFile(result, 'externalStorage'); @@ -53,7 +53,7 @@ void main() { testWidgets('getExternalCacheDirectories', (WidgetTester tester) async { if (Platform.isIOS) { final Future?> result = getExternalCacheDirectories(); - await expectLater(result, throwsA(isInstanceOf())); + expect(result, throwsA(isInstanceOf())); } else if (Platform.isAndroid) { final List? directories = await getExternalCacheDirectories(); expect(directories, isNotNull); @@ -79,7 +79,7 @@ void main() { (WidgetTester tester) async { if (Platform.isIOS) { final Future?> result = getExternalStorageDirectories(); - await expectLater(result, throwsA(isInstanceOf())); + expect(result, throwsA(isInstanceOf())); } else if (Platform.isAndroid) { final List? directories = await getExternalStorageDirectories(type: type); diff --git a/packages/path_provider/path_provider_android/CHANGELOG.md b/packages/path_provider/path_provider_android/CHANGELOG.md index 407f1504d69..ef8b082d4c0 100644 --- a/packages/path_provider/path_provider_android/CHANGELOG.md +++ b/packages/path_provider/path_provider_android/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.2.1 + +* Adds permissions to read images, video, and audio files to ensure external + directories exist in testing. + ## 2.2.0 * Adds implementation of `getDownloadsDirectory()`. diff --git a/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml b/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml index df8cee7bc3b..0c497742732 100644 --- a/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml @@ -2,6 +2,9 @@ package="io.flutter.plugins.pathproviderexample"> + + ! + =2.19.0 <4.0.0"