diff --git a/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md index eefc0453181e..6cbc715cdd63 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.5 + +* Google Maps requires at least Android SDK 20. + ## 2.0.4 * Unpin iOS GoogleMaps pod dependency version. diff --git a/packages/google_maps_flutter/google_maps_flutter/README.md b/packages/google_maps_flutter/google_maps_flutter/README.md index 767ef8c1a561..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,19 @@ For more details, see [Getting started with Google Maps Platform](https://develo ### Android -Specify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`: +1. Set the `minSdkVersion` in `android/app/build.gradle`: + +```groovy +android { + defaultConfig { + minSdkVersion 20 + } +} +``` + +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`: ```xml =2.12.0 <3.0.0" 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 d825703f1731..e02ebb70f50b 100644 --- a/script/tool/lib/src/create_all_plugins_app_command.dart +++ b/script/tool/lib/src/create_all_plugins_app_command.dart @@ -81,7 +81,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 {')) {