Skip to content

Commit 6841bb1

Browse files
authored
[Many] Bump to min minSdkVersion of 19 across all plugins (#6506)
* Bumps any `minSdkVersion`'s below 19 to 19, as the change to only support 19+ has been in stable for a bit now. * Bumps the minimum required flutter version to 3.16 for the changed packages, as that is the first version in which we started automigrating `minSdkVersion`'s less than 19. * Also bumps the `minSdkVersion` in the legacy project to `flutter.minSdkVersion`, as this would happen when running an app with `minSdkVersion` < 19. * Removes some code branches for cases of sdk < 19. * Fixes some failing tests in `video_player` - for full transparency, I have now idea how these could have been passing before?
1 parent fc47eb7 commit 6841bb1

File tree

34 files changed

+87
-85
lines changed

34 files changed

+87
-85
lines changed

.ci/legacy_project/all_packages/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929

3030
defaultConfig {
3131
applicationId "com.example.all_packages"
32-
minSdkVersion 16
32+
minSdkVersion flutter.minSdkVersion
3333
targetSdkVersion 30
3434
versionCode flutterVersionCode.toInteger()
3535
versionName flutterVersionName

packages/espresso/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 0.3.0+8
22

3-
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
3+
* Updates minSdkVersion to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
45
* Updates compileSdk version to 34.
56

67
## 0.3.0+7

packages/espresso/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
compileSdk 34
3030

3131
defaultConfig {
32-
minSdkVersion 16
32+
minSdkVersion 19
3333
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3434
}
3535

packages/espresso/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ description: Java classes for testing Flutter apps using Espresso.
33
Allows driving Flutter widgets from a native Espresso test.
44
repository: https://github.com/flutter/packages/tree/main/packages/espresso
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+espresso%22
6-
version: 0.3.0+7
6+
version: 0.3.0+8
77

88
environment:
9-
sdk: ^3.1.0
10-
flutter: ">=3.13.0"
9+
sdk: ^3.2.0
10+
flutter: ">=3.16.0"
1111

1212
flutter:
1313
plugin:

packages/flutter_plugin_android_lifecycle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.0.19
2+
3+
* Updates minSdkVersion to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
5+
16
## 2.0.18
27

38
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.

packages/flutter_plugin_android_lifecycle/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
compileSdk 34
3030

3131
defaultConfig {
32-
minSdkVersion 16
32+
minSdkVersion 19
3333
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3434
consumerProguardFiles 'proguard.txt'
3535
}

packages/flutter_plugin_android_lifecycle/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: flutter_plugin_android_lifecycle
22
description: Flutter plugin for accessing an Android Lifecycle within other plugins.
33
repository: https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_plugin_android_lifecycle%22
5-
version: 2.0.18
5+
version: 2.0.19
66

77
environment:
8-
sdk: ^3.1.0
9-
flutter: ">=3.13.0"
8+
sdk: ^3.2.0
9+
flutter: ">=3.16.0"
1010

1111
flutter:
1212
plugin:

packages/google_sign_in/google_sign_in_android/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 6.1.23
2+
3+
* Updates minSdkVersion to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
5+
16
## 6.1.22
27

38
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.

packages/google_sign_in/google_sign_in_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
compileSdk 34
3030

3131
defaultConfig {
32-
minSdkVersion 16
32+
minSdkVersion 19
3333
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3434
}
3535

packages/google_sign_in/google_sign_in_android/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: google_sign_in_android
22
description: Android implementation of the google_sign_in plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
5-
version: 6.1.22
5+
version: 6.1.23
66

77
environment:
8-
sdk: ^3.1.0
9-
flutter: ">=3.13.0"
8+
sdk: ^3.2.0
9+
flutter: ">=3.16.0"
1010

1111
flutter:
1212
plugin:

packages/image_picker/image_picker_android/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.8.9+6
2+
3+
* Updates minSdkVersion to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
5+
16
## 0.8.9+5
27

38
* Bumps androidx.exifinterface:exifinterface from 1.3.6 to 1.3.7.

packages/image_picker/image_picker_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
compileSdk 34
3030

3131
defaultConfig {
32-
minSdkVersion 16
32+
minSdkVersion 19
3333
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3434
}
3535
lintOptions {

packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerDelegate.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public void chooseMediaFromGallery(
295295

296296
private void launchPickMediaFromGalleryIntent(Messages.GeneralOptions generalOptions) {
297297
Intent pickMediaIntent;
298-
if (generalOptions.getUsePhotoPicker() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
298+
if (generalOptions.getUsePhotoPicker()) {
299299
if (generalOptions.getAllowMultiple()) {
300300
pickMediaIntent =
301301
new ActivityResultContracts.PickMultipleVisualMedia()
@@ -320,9 +320,7 @@ private void launchPickMediaFromGalleryIntent(Messages.GeneralOptions generalOpt
320320
pickMediaIntent.setType("*/*");
321321
String[] mimeTypes = {"video/*", "image/*"};
322322
pickMediaIntent.putExtra("CONTENT_TYPE", mimeTypes);
323-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
324-
pickMediaIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, generalOptions.getAllowMultiple());
325-
}
323+
pickMediaIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, generalOptions.getAllowMultiple());
326324
}
327325
activity.startActivityForResult(pickMediaIntent, REQUEST_CODE_CHOOSE_MEDIA_FROM_GALLERY);
328326
}
@@ -341,7 +339,7 @@ public void chooseVideoFromGallery(
341339

342340
private void launchPickVideoFromGalleryIntent(Boolean usePhotoPicker) {
343341
Intent pickVideoIntent;
344-
if (usePhotoPicker && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
342+
if (usePhotoPicker) {
345343
pickVideoIntent =
346344
new ActivityResultContracts.PickVisualMedia()
347345
.createIntent(
@@ -439,7 +437,7 @@ public void chooseMultiImageFromGallery(
439437

440438
private void launchPickImageFromGalleryIntent(Boolean usePhotoPicker) {
441439
Intent pickImageIntent;
442-
if (usePhotoPicker && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
440+
if (usePhotoPicker) {
443441
pickImageIntent =
444442
new ActivityResultContracts.PickVisualMedia()
445443
.createIntent(
@@ -456,7 +454,7 @@ private void launchPickImageFromGalleryIntent(Boolean usePhotoPicker) {
456454

457455
private void launchMultiPickImageFromGalleryIntent(Boolean usePhotoPicker) {
458456
Intent pickMultiImageIntent;
459-
if (usePhotoPicker && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
457+
if (usePhotoPicker) {
460458
pickMultiImageIntent =
461459
new ActivityResultContracts.PickMultipleVisualMedia()
462460
.createIntent(
@@ -467,9 +465,7 @@ private void launchMultiPickImageFromGalleryIntent(Boolean usePhotoPicker) {
467465
} else {
468466
pickMultiImageIntent = new Intent(Intent.ACTION_GET_CONTENT);
469467
pickMultiImageIntent.setType("image/*");
470-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
471-
pickMultiImageIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
472-
}
468+
pickMultiImageIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
473469
}
474470
activity.startActivityForResult(
475471
pickMultiImageIntent, REQUEST_CODE_CHOOSE_MULTI_IMAGE_FROM_GALLERY);

packages/image_picker/image_picker_android/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: image_picker_android
22
description: Android implementation of the image_picker plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
5-
version: 0.8.9+5
5+
version: 0.8.9+6
66

77
environment:
8-
sdk: ^3.1.0
9-
flutter: ">=3.13.0"
8+
sdk: ^3.2.0
9+
flutter: ">=3.16.0"
1010

1111
flutter:
1212
plugin:

packages/path_provider/path_provider_android/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.2.4
2+
3+
* Updates minSdkVersion version to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
5+
16
## 2.2.3
27

38
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.

packages/path_provider/path_provider_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
compileSdk 34
3030

3131
defaultConfig {
32-
minSdkVersion 16
32+
minSdkVersion 19
3333
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3434
}
3535
lintOptions {

packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
package io.flutter.plugins.pathprovider;
66

77
import android.content.Context;
8-
import android.os.Build.VERSION;
9-
import android.os.Build.VERSION_CODES;
108
import android.util.Log;
119
import androidx.annotation.NonNull;
1210
import androidx.annotation.Nullable;
@@ -110,14 +108,7 @@ private String getPathProviderStorageDirectory() {
110108
private List<String> getPathProviderExternalCacheDirectories() {
111109
final List<String> paths = new ArrayList<>();
112110

113-
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
114-
for (File dir : context.getExternalCacheDirs()) {
115-
if (dir != null) {
116-
paths.add(dir.getAbsolutePath());
117-
}
118-
}
119-
} else {
120-
File dir = context.getExternalCacheDir();
111+
for (File dir : context.getExternalCacheDirs()) {
121112
if (dir != null) {
122113
paths.add(dir.getAbsolutePath());
123114
}
@@ -159,14 +150,7 @@ private List<String> getPathProviderExternalStorageDirectories(
159150
@NonNull Messages.StorageDirectory directory) {
160151
final List<String> paths = new ArrayList<>();
161152

162-
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
163-
for (File dir : context.getExternalFilesDirs(getStorageDirectoryString(directory))) {
164-
if (dir != null) {
165-
paths.add(dir.getAbsolutePath());
166-
}
167-
}
168-
} else {
169-
File dir = context.getExternalFilesDir(getStorageDirectoryString(directory));
153+
for (File dir : context.getExternalFilesDirs(getStorageDirectoryString(directory))) {
170154
if (dir != null) {
171155
paths.add(dir.getAbsolutePath());
172156
}

packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/StorageDirectoryMapper.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
package io.flutter.plugins.pathprovider;
66

7-
import android.os.Build.VERSION;
8-
import android.os.Build.VERSION_CODES;
97
import android.os.Environment;
108

119
/** Helps to map the Dart `StorageDirectory` enum to a Android system constant. */
@@ -42,11 +40,7 @@ static String androidType(Integer dartIndex) throws IllegalArgumentException {
4240
case 8:
4341
return Environment.DIRECTORY_DCIM;
4442
case 9:
45-
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
46-
return Environment.DIRECTORY_DOCUMENTS;
47-
} else {
48-
throw new IllegalArgumentException("Documents directory is unsupported.");
49-
}
43+
return Environment.DIRECTORY_DOCUMENTS;
5044
default:
5145
throw new IllegalArgumentException("Unknown index: " + dartIndex);
5246
}

packages/path_provider/path_provider_android/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: path_provider_android
22
description: Android implementation of the path_provider plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22
5-
version: 2.2.3
5+
version: 2.2.4
66

77
environment:
8-
sdk: ^3.1.0
9-
flutter: ">=3.13.0"
8+
sdk: ^3.2.0
9+
flutter: ">=3.16.0"
1010

1111
flutter:
1212
plugin:

packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ android {
3434
}
3535

3636
defaultConfig {
37-
minSdkVersion 16
37+
minSdkVersion 19
3838
}
3939

4040
testOptions {

packages/pigeon/platform_tests/test_plugin/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ android {
4646
}
4747

4848
defaultConfig {
49-
minSdkVersion 16
49+
minSdkVersion 19
5050
}
5151

5252
testOptions {

packages/quick_actions/quick_actions_android/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 1.0.11
22

3-
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
3+
* Updates minSdkVersion to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
45
* Updates compileSdk version to 34.
56

67
## 1.0.10

packages/quick_actions/quick_actions_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
compileSdk 34
3030

3131
defaultConfig {
32-
minSdkVersion 16
32+
minSdkVersion 19
3333
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3434
}
3535
lintOptions {

packages/quick_actions/quick_actions_android/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: quick_actions_android
22
description: An implementation for the Android platform of the Flutter `quick_actions` plugin.
33
repository: https://github.com/flutter/packages/tree/main/packages/quick_actions/quick_actions_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
5-
version: 1.0.10
5+
version: 1.0.11
66

77
environment:
8-
sdk: ^3.1.0
9-
flutter: ">=3.13.0"
8+
sdk: ^3.2.0
9+
flutter: ">=3.16.0"
1010

1111
flutter:
1212
plugin:

packages/shared_preferences/shared_preferences_android/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 2.2.2
22

3-
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
3+
* Updates minSdkVersion to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
45
* Updates compileSdk version to 34.
56
* Updates mockito to 5.2.0.
67

packages/shared_preferences/shared_preferences_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android {
4242
}
4343

4444
defaultConfig {
45-
minSdkVersion 16
45+
minSdkVersion 19
4646
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4747
}
4848
lintOptions {

packages/shared_preferences/shared_preferences_android/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: shared_preferences_android
22
description: Android implementation of the shared_preferences plugin
33
repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22
5-
version: 2.2.1
5+
version: 2.2.2
66

77
environment:
8-
sdk: ^3.1.0
9-
flutter: ">=3.13.0"
8+
sdk: ^3.2.0
9+
flutter: ">=3.16.0"
1010

1111
flutter:
1212
plugin:

packages/url_launcher/url_launcher_android/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 6.3.1
22

3-
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
3+
* Updates minSdkVersion to 19.
4+
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
45

56
## 6.3.0
67

0 commit comments

Comments
 (0)