From 68ab058cbbab18b1460f437688b3de5c00498bdb Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Thu, 6 May 2021 15:30:56 -0700 Subject: [PATCH 1/8] [webview_flutter] Android Webview requires SDK 19 --- packages/webview_flutter/CHANGELOG.md | 5 +++++ packages/webview_flutter/android/build.gradle | 2 +- packages/webview_flutter/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md index 85767577c403..49da599ae68e 100644 --- a/packages/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.0.5 + +* WebView requires at least Android 19 if you are using +hybrid composition ([flutter/issues/59894](https://github.com/flutter/flutter/issues/59894)). + ## 2.0.4 * Fix a bug where `allowsInlineMediaPlayback` is not respected on iOS. diff --git a/packages/webview_flutter/android/build.gradle b/packages/webview_flutter/android/build.gradle index 307dfcfa0b8e..b9231beafa46 100644 --- a/packages/webview_flutter/android/build.gradle +++ b/packages/webview_flutter/android/build.gradle @@ -25,7 +25,7 @@ android { compileSdkVersion 29 defaultConfig { - minSdkVersion 16 + minSdkVersion 19 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml index 3f5f70b6717d..98ab582a3554 100644 --- a/packages/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter -version: 2.0.4 +version: 2.0.5 environment: sdk: ">=2.12.0 <3.0.0" From 53f778bfc2080eb4231c7db27029aee2e7f2a361 Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Thu, 6 May 2021 15:35:15 -0700 Subject: [PATCH 2/8] Line for consistency --- packages/webview_flutter/android/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/webview_flutter/android/build.gradle b/packages/webview_flutter/android/build.gradle index b9231beafa46..5c5ed6299fee 100644 --- a/packages/webview_flutter/android/build.gradle +++ b/packages/webview_flutter/android/build.gradle @@ -28,6 +28,7 @@ android { minSdkVersion 19 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + lintOptions { disable 'InvalidPackage' } From 4f2ed6c77d098b5761e3081cbda735198be5314f Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Thu, 6 May 2021 15:43:26 -0700 Subject: [PATCH 3/8] Add Google Maps and update test --- .../google_maps_flutter/google_maps_flutter/CHANGELOG.md | 4 ++++ .../google_maps_flutter/android/build.gradle | 2 +- .../google_maps_flutter/google_maps_flutter/pubspec.yaml | 2 +- packages/webview_flutter/example/android/app/build.gradle | 2 +- script/tool/lib/src/create_all_plugins_app_command.dart | 8 +++++++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index f36c9b0a229c..19a769f06602 100644 --- a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.4 + +* Google Maps requires at least Android SDK 20. + ## 2.0.3 * Fix incorrect typecast in TileOverlay example. diff --git a/packages/google_maps_flutter/google_maps_flutter/android/build.gradle b/packages/google_maps_flutter/google_maps_flutter/android/build.gradle index 479c100b8293..36b2ac6826d2 100644 --- a/packages/google_maps_flutter/google_maps_flutter/android/build.gradle +++ b/packages/google_maps_flutter/google_maps_flutter/android/build.gradle @@ -25,7 +25,7 @@ android { compileSdkVersion 29 defaultConfig { - minSdkVersion 16 + minSdkVersion 20 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { diff --git a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml index 8c6de691ecf3..cdd629c39170 100644 --- a/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter -version: 2.0.3 +version: 2.0.4 dependencies: flutter: diff --git a/packages/webview_flutter/example/android/app/build.gradle b/packages/webview_flutter/example/android/app/build.gradle index 619a3aead7b2..47eb97623747 100644 --- a/packages/webview_flutter/example/android/app/build.gradle +++ b/packages/webview_flutter/example/android/app/build.gradle @@ -34,7 +34,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "io.flutter.plugins.webviewflutterexample" - minSdkVersion 16 + minSdkVersion 19 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/script/tool/lib/src/create_all_plugins_app_command.dart b/script/tool/lib/src/create_all_plugins_app_command.dart index 4b5b4c6b8df4..0fb7bf8f524d 100644 --- a/script/tool/lib/src/create_all_plugins_app_command.dart +++ b/script/tool/lib/src/create_all_plugins_app_command.dart @@ -79,7 +79,13 @@ class CreateAllPluginsAppCommand extends PluginCommand { final StringBuffer newGradle = StringBuffer(); for (final String line in gradleFile.readAsLinesSync()) { - newGradle.writeln(line); + if (line.contains('minSdkVersion 16')) { + // Android SDK 20 is required by Google maps. + // Android SDK 19 is required by WebView. + newGradle.writeln('minSdkVersion 20'); + } else { + newGradle.writeln(line); + } if (line.contains('defaultConfig {')) { newGradle.writeln(' multiDexEnabled true'); } else if (line.contains('dependencies {')) { From 83b955d04b152364f9111d51e07ec861f69ad635 Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Fri, 14 May 2021 16:26:49 -0700 Subject: [PATCH 4/8] Update readme --- packages/google_maps_flutter/google_maps_flutter/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google_maps_flutter/google_maps_flutter/README.md b/packages/google_maps_flutter/google_maps_flutter/README.md index 767ef8c1a561..c6f035887ee8 100644 --- a/packages/google_maps_flutter/google_maps_flutter/README.md +++ b/packages/google_maps_flutter/google_maps_flutter/README.md @@ -25,6 +25,8 @@ For more details, see [Getting started with Google Maps Platform](https://develo ### Android +**Important:** The Google Maps plugin requires Android SDK 20. + Specify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`: ```xml From 99a9f7c689853c4bc2fc0429811835808d848c1c Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Fri, 14 May 2021 16:30:00 -0700 Subject: [PATCH 5/8] Example app --- .../google_maps_flutter/example/android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/build.gradle b/packages/google_maps_flutter/google_maps_flutter/example/android/app/build.gradle index 0bdb5a2c6a68..1a8cdf52cc46 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/build.gradle +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/build.gradle @@ -33,7 +33,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.googlemapsexample" - minSdkVersion 16 + minSdkVersion 20 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName From 5abe8f7ec804e612721503686a0b5b2568150a6b Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Fri, 14 May 2021 16:36:45 -0700 Subject: [PATCH 6/8] Polish readme --- .../google_maps_flutter/README.md | 14 ++++++++++++-- packages/webview_flutter/README.md | 14 +++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/README.md b/packages/google_maps_flutter/google_maps_flutter/README.md index c6f035887ee8..a448f5252d66 100644 --- a/packages/google_maps_flutter/google_maps_flutter/README.md +++ b/packages/google_maps_flutter/google_maps_flutter/README.md @@ -25,9 +25,19 @@ For more details, see [Getting started with Google Maps Platform](https://develo ### Android -**Important:** The Google Maps plugin requires Android SDK 20. +1. Set the `minSdkVersion` in `/android/app/build.gradle`: -Specify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`: +```groovy +android { + defaultConfig { + minSdkVersion 20 + } +} +``` + +**Important:** This means that app would require users to have Android SDK 20 or higher. + +2. Specify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`: ```xml /android/app/build.gradle`: + +```groovy +android { + defaultConfig { + minSdkVersion 20 + } +} +``` + +**Important:** This means that app would require users to have Android SDK 20 or higher. + +2. To enable hybrid composition, set `WebView.platform = SurfaceAndroidWebView();` in `initState()`. For example: ```dart From b1981a18affa386aa3ae5b30b739369a9ad55245 Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Fri, 14 May 2021 16:38:28 -0700 Subject: [PATCH 7/8] Fix version --- packages/google_maps_flutter/google_maps_flutter/README.md | 2 +- packages/webview_flutter/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/README.md b/packages/google_maps_flutter/google_maps_flutter/README.md index a448f5252d66..1e3f85e31dc7 100644 --- a/packages/google_maps_flutter/google_maps_flutter/README.md +++ b/packages/google_maps_flutter/google_maps_flutter/README.md @@ -35,7 +35,7 @@ android { } ``` -**Important:** This means that app would require users to have Android SDK 20 or higher. +This means that app will only be available for users that run Android SDK 20 or higher. 2. Specify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`: diff --git a/packages/webview_flutter/README.md b/packages/webview_flutter/README.md index 0c44375d9c29..45e6d81a1c8b 100644 --- a/packages/webview_flutter/README.md +++ b/packages/webview_flutter/README.md @@ -31,12 +31,12 @@ implementation. Note that on Android versions prior to Android 10 Hybrid Composi ```groovy android { defaultConfig { - minSdkVersion 20 + minSdkVersion 19 } } ``` -**Important:** This means that app would require users to have Android SDK 20 or higher. +This means that app will only be available for users that run Android SDK 19 or higher. 2. To enable hybrid composition, set `WebView.platform = SurfaceAndroidWebView();` in `initState()`. For example: From 5e97d230dc6f1a3690f97e7e149b1e18bc73959c Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Fri, 14 May 2021 16:56:34 -0700 Subject: [PATCH 8/8] Remove --- packages/google_maps_flutter/google_maps_flutter/README.md | 2 +- packages/webview_flutter/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter/README.md b/packages/google_maps_flutter/google_maps_flutter/README.md index 1e3f85e31dc7..c80fcb949dad 100644 --- a/packages/google_maps_flutter/google_maps_flutter/README.md +++ b/packages/google_maps_flutter/google_maps_flutter/README.md @@ -25,7 +25,7 @@ For more details, see [Getting started with Google Maps Platform](https://develo ### Android -1. Set the `minSdkVersion` in `/android/app/build.gradle`: +1. Set the `minSdkVersion` in `android/app/build.gradle`: ```groovy android { diff --git a/packages/webview_flutter/README.md b/packages/webview_flutter/README.md index 45e6d81a1c8b..21bf22176182 100644 --- a/packages/webview_flutter/README.md +++ b/packages/webview_flutter/README.md @@ -26,7 +26,7 @@ implementation. Note that on Android versions prior to Android 10 Hybrid Composi ### Using Hybrid Composition -1. Set the `minSdkVersion` in `/android/app/build.gradle`: +1. Set the `minSdkVersion` in `android/app/build.gradle`: ```groovy android {