From 68f54266f5f05d10d483bf420437de11c1bcd449 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 25 Apr 2023 08:38:53 -0700 Subject: [PATCH] [various] Adds Android namespace (#3791) Adds a `namespace` attribute to the Android build.gradle, for compatibility with Android Gradle Plugin 8.0, and adds tooling to enforce that it's there. This is necessary for plugins now; for examples this isn't needed yet, but since it will be needed to eventually update the apps to AGP 8.0 anyway, it's easiest to just enforce it everywhere now. --- .../example/android/app/build.gradle | 1 + .../camera/example/android/app/build.gradle | 1 + packages/camera/camera_android/CHANGELOG.md | 4 + .../camera_android/android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + packages/camera/camera_android/pubspec.yaml | 2 +- .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../example/android/app/build.gradle | 1 + packages/espresso/CHANGELOG.md | 4 + packages/espresso/android/build.gradle | 1 + packages/espresso/pubspec.yaml | 2 +- .../CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../pubspec.yaml | 2 +- .../google_maps_flutter_android/CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../google_maps_flutter_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../google_sign_in_android/CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../google_sign_in_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../image_picker_android/CHANGELOG.md | 4 + .../image_picker_android/android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../image_picker_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../in_app_purchase_android/CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../in_app_purchase_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../local_auth_android/CHANGELOG.md | 4 + .../local_auth_android/android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../local_auth_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../path_provider_android/CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../path_provider_android/pubspec.yaml | 2 +- .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../test_plugin/android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../quick_actions_android/CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../quick_actions_android/pubspec.yaml | 2 +- .../example/hello/android/app/build.gradle | 1 + .../rfw/example/hello/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../example/local/android/app/build.gradle | 1 + .../rfw/example/local/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../example/remote/android/app/build.gradle | 1 + .../rfw/example/remote/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../example/android/app/build.gradle | 1 + .../shared_preferences_android/CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../shared_preferences_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../url_launcher_android/CHANGELOG.md | 4 + .../url_launcher_android/android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../url_launcher_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../video_player_android/CHANGELOG.md | 4 + .../video_player_android/android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../video_player_android/pubspec.yaml | 2 +- .../example/android/app/build.gradle | 1 + .../webview_flutter_android/CHANGELOG.md | 4 + .../android/build.gradle | 1 + .../example/android/app/build.gradle | 1 + .../webview_flutter_android/pubspec.yaml | 2 +- script/tool/lib/src/gradle_check_command.dart | 184 +++++++++++++++--- .../tool/test/gradle_check_command_test.dart | 176 ++++++++++++++++- 84 files changed, 454 insertions(+), 56 deletions(-) diff --git a/packages/animations/example/android/app/build.gradle b/packages/animations/example/android/app/build.gradle index c6bffc943b6..b4f6ed166a0 100644 --- a/packages/animations/example/android/app/build.gradle +++ b/packages/animations/example/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'dev.flutter.packages.animations.example' compileSdkVersion flutter.compileSdkVersion sourceSets { diff --git a/packages/camera/camera/example/android/app/build.gradle b/packages/camera/camera/example/android/app/build.gradle index bc7f995cf0d..bd55a351f0c 100644 --- a/packages/camera/camera/example/android/app/build.gradle +++ b/packages/camera/camera/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.cameraexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 89514a15575..661cafd3bb8 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.6+1 + +* Adds a namespace for compatibility with AGP 8.0. + ## 0.10.6 * Fixes Java warnings. diff --git a/packages/camera/camera_android/android/build.gradle b/packages/camera/camera_android/android/build.gradle index d93d06aaf4d..6b437709809 100644 --- a/packages/camera/camera_android/android/build.gradle +++ b/packages/camera/camera_android/android/build.gradle @@ -27,6 +27,7 @@ project.getTasks().withType(JavaCompile){ apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.camera' compileSdkVersion 33 defaultConfig { diff --git a/packages/camera/camera_android/example/android/app/build.gradle b/packages/camera/camera_android/example/android/app/build.gradle index bc7f995cf0d..bd55a351f0c 100644 --- a/packages/camera/camera_android/example/android/app/build.gradle +++ b/packages/camera/camera_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.cameraexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index 4e05a55f4d2..2b7c0c29e28 100644 --- a/packages/camera/camera_android/pubspec.yaml +++ b/packages/camera/camera_android/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android description: Android implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.6 +version: 0.10.6+1 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/camera/camera_android_camerax/android/build.gradle b/packages/camera/camera_android_camerax/android/build.gradle index 492d1374b8a..1ae38c243a5 100644 --- a/packages/camera/camera_android_camerax/android/build.gradle +++ b/packages/camera/camera_android_camerax/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.camerax' // CameraX dependencies require compilation against version 33 or later. compileSdkVersion 33 diff --git a/packages/camera/camera_android_camerax/example/android/app/build.gradle b/packages/camera/camera_android_camerax/example/android/app/build.gradle index e2001f9ab77..44b11029bb1 100644 --- a/packages/camera/camera_android_camerax/example/android/app/build.gradle +++ b/packages/camera/camera_android_camerax/example/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.cameraxexample' compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/packages/dynamic_layouts/example/android/app/build.gradle b/packages/dynamic_layouts/example/android/app/build.gradle index 823df22bf35..a898241f15b 100644 --- a/packages/dynamic_layouts/example/android/app/build.gradle +++ b/packages/dynamic_layouts/example/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'dev.flutter.packages.animations.example' compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/packages/espresso/CHANGELOG.md b/packages/espresso/CHANGELOG.md index 2a318f20a29..660fcc7e0b6 100644 --- a/packages/espresso/CHANGELOG.md +++ b/packages/espresso/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.0+2 + +* Adds a namespace for compatibility with AGP 8.0. + ## 0.3.0+1 * Sets an explicit Java compatibility version. diff --git a/packages/espresso/android/build.gradle b/packages/espresso/android/build.gradle index c169b19dbaa..0b8960b377e 100644 --- a/packages/espresso/android/build.gradle +++ b/packages/espresso/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'com.example.espresso' compileSdkVersion 33 defaultConfig { diff --git a/packages/espresso/pubspec.yaml b/packages/espresso/pubspec.yaml index baf0b7d2dc5..a67455d272f 100644 --- a/packages/espresso/pubspec.yaml +++ b/packages/espresso/pubspec.yaml @@ -3,7 +3,7 @@ description: Java classes for testing Flutter apps using Espresso. Allows driving Flutter widgets from a native Espresso test. repository: https://github.com/flutter/packages/tree/main/packages/espresso issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+espresso%22 -version: 0.3.0+1 +version: 0.3.0+2 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md index 6e1dad03105..9e97351f91b 100644 --- a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md +++ b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.11 + +* Adds a namespace for compatibility with AGP 8.0. + ## 2.0.10 * Sets an explicit Java compatibility version. diff --git a/packages/flutter_plugin_android_lifecycle/android/build.gradle b/packages/flutter_plugin_android_lifecycle/android/build.gradle index 72c4a127e28..c12cc355470 100644 --- a/packages/flutter_plugin_android_lifecycle/android/build.gradle +++ b/packages/flutter_plugin_android_lifecycle/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.flutter_plugin_android_lifecycle' compileSdkVersion 33 defaultConfig { diff --git a/packages/flutter_plugin_android_lifecycle/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/pubspec.yaml index d8c92d030d7..ae7686f6237 100644 --- a/packages/flutter_plugin_android_lifecycle/pubspec.yaml +++ b/packages/flutter_plugin_android_lifecycle/pubspec.yaml @@ -2,7 +2,7 @@ name: flutter_plugin_android_lifecycle description: Flutter plugin for accessing an Android Lifecycle within other plugins. repository: https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_plugin_android_lifecycle%22 -version: 2.0.10 +version: 2.0.11 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index c16464fb4e6..5284648c8e7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.11 + +* Adds a namespace for compatibility with AGP 8.0. + ## 2.4.10 * Bump RoboElectric dependency to 4.4.1 to support AndroidX. diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle index 61b79a90a37..5f8c17e81a9 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.googlemaps' compileSdkVersion 33 defaultConfig { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle index b6e7a5189b1..831b3b2e82c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.googlemapsexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 6ae316db6b6..4b9315bae22 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_android description: Android implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.4.10 +version: 2.4.11 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/google_sign_in/google_sign_in/example/android/app/build.gradle b/packages/google_sign_in/google_sign_in/example/android/app/build.gradle index cf21021f325..3c40ac3ea0a 100644 --- a/packages/google_sign_in/google_sign_in/example/android/app/build.gradle +++ b/packages/google_sign_in/google_sign_in/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.googlesigninexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md index 4f4f6dd7561..fcbe694a3f4 100644 --- a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.12 + +* Adds a namespace for compatibility with AGP 8.0. + ## 6.1.11 * Fixes Java warnings. diff --git a/packages/google_sign_in/google_sign_in_android/android/build.gradle b/packages/google_sign_in/google_sign_in_android/android/build.gradle index ae2abf5b163..88ae5fc3f81 100644 --- a/packages/google_sign_in/google_sign_in_android/android/build.gradle +++ b/packages/google_sign_in/google_sign_in_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.googlesignin' compileSdkVersion 33 defaultConfig { diff --git a/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle b/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle index cf21021f325..3c40ac3ea0a 100644 --- a/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle +++ b/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.googlesigninexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/google_sign_in/google_sign_in_android/pubspec.yaml b/packages/google_sign_in/google_sign_in_android/pubspec.yaml index 921e7f1d9d3..2998b53d2df 100644 --- a/packages/google_sign_in/google_sign_in_android/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_sign_in_android description: Android implementation of the google_sign_in plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 6.1.11 +version: 6.1.12 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/image_picker/image_picker/example/android/app/build.gradle b/packages/image_picker/image_picker/example/android/app/build.gradle index 22f3f11f43b..114f48f8411 100755 --- a/packages/image_picker/image_picker/example/android/app/build.gradle +++ b/packages/image_picker/image_picker/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.imagepickerexample' compileSdkVersion flutter.compileSdkVersion testOptions.unitTests.includeAndroidResources = true diff --git a/packages/image_picker/image_picker_android/CHANGELOG.md b/packages/image_picker/image_picker_android/CHANGELOG.md index 6324d84f865..51281722190 100644 --- a/packages/image_picker/image_picker_android/CHANGELOG.md +++ b/packages/image_picker/image_picker_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.6+8 + +* Adds a namespace for compatibility with AGP 8.0. + ## 0.8.6+7 * Fixes handling of non-bitmap image types. diff --git a/packages/image_picker/image_picker_android/android/build.gradle b/packages/image_picker/image_picker_android/android/build.gradle index c4fb379533f..777a4e4676c 100644 --- a/packages/image_picker/image_picker_android/android/build.gradle +++ b/packages/image_picker/image_picker_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.imagepicker' compileSdkVersion 33 defaultConfig { diff --git a/packages/image_picker/image_picker_android/example/android/app/build.gradle b/packages/image_picker/image_picker_android/example/android/app/build.gradle index d76036b3289..070f632d2e7 100755 --- a/packages/image_picker/image_picker_android/example/android/app/build.gradle +++ b/packages/image_picker/image_picker_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.imagepickerexample' compileSdkVersion flutter.compileSdkVersion testOptions.unitTests.includeAndroidResources = true diff --git a/packages/image_picker/image_picker_android/pubspec.yaml b/packages/image_picker/image_picker_android/pubspec.yaml index b1dad503864..349cacc8b35 100755 --- a/packages/image_picker/image_picker_android/pubspec.yaml +++ b/packages/image_picker/image_picker_android/pubspec.yaml @@ -3,7 +3,7 @@ description: Android implementation of the image_picker plugin. repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 0.8.6+7 +version: 0.8.6+8 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle b/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle index 274443d6604..774bccc1258 100644 --- a/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle +++ b/packages/in_app_purchase/in_app_purchase/example/android/app/build.gradle @@ -54,6 +54,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.inapppurchaseexample' signingConfigs { release { storeFile project.KEYSTORE_STORE_FILE diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md index b4cce00f2d1..37a18ea7303 100644 --- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.5+1 + +* Adds a namespace for compatibility with AGP 8.0. + ## 0.2.5 * Fixes the management of `BillingClient` connection by handling `BillingResponse.serviceDisconnected`. diff --git a/packages/in_app_purchase/in_app_purchase_android/android/build.gradle b/packages/in_app_purchase/in_app_purchase_android/android/build.gradle index 4385ad821f5..615ff6959e4 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/build.gradle +++ b/packages/in_app_purchase/in_app_purchase_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.inapppurchase' compileSdkVersion 33 defaultConfig { diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle b/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle index 3eab36907d4..30cfea4713f 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/app/build.gradle @@ -54,6 +54,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.inapppurchaseexample' compileSdkVersion flutter.compileSdkVersion signingConfigs { diff --git a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml index 0d9dc31d290..8e7d68511b4 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_android description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.2.5 +version: 0.2.5+1 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/local_auth/local_auth/example/android/app/build.gradle b/packages/local_auth/local_auth/example/android/app/build.gradle index 751b11824ad..29813d85908 100644 --- a/packages/local_auth/local_auth/example/android/app/build.gradle +++ b/packages/local_auth/local_auth/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.localauthexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/local_auth/local_auth_android/CHANGELOG.md b/packages/local_auth/local_auth_android/CHANGELOG.md index aef9fe308ba..2cf84b938e4 100644 --- a/packages/local_auth/local_auth_android/CHANGELOG.md +++ b/packages/local_auth/local_auth_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.25 + +* Adds a namespace for compatibility with AGP 8.0. + ## 1.0.24 * Fixes `getEnrolledBiometrics` return value handling. diff --git a/packages/local_auth/local_auth_android/android/build.gradle b/packages/local_auth/local_auth_android/android/build.gradle index 53ef4f47d8c..bcb7183a57d 100644 --- a/packages/local_auth/local_auth_android/android/build.gradle +++ b/packages/local_auth/local_auth_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.localauth' compileSdkVersion 33 defaultConfig { diff --git a/packages/local_auth/local_auth_android/example/android/app/build.gradle b/packages/local_auth/local_auth_android/example/android/app/build.gradle index 751b11824ad..29813d85908 100644 --- a/packages/local_auth/local_auth_android/example/android/app/build.gradle +++ b/packages/local_auth/local_auth_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.localauthexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/local_auth/local_auth_android/pubspec.yaml b/packages/local_auth/local_auth_android/pubspec.yaml index 0d1dd4308da..e5f419639c6 100644 --- a/packages/local_auth/local_auth_android/pubspec.yaml +++ b/packages/local_auth/local_auth_android/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth_android description: Android implementation of the local_auth plugin. repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22 -version: 1.0.24 +version: 1.0.25 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/path_provider/path_provider/example/android/app/build.gradle b/packages/path_provider/path_provider/example/android/app/build.gradle index fea015334ab..f0e38191162 100644 --- a/packages/path_provider/path_provider/example/android/app/build.gradle +++ b/packages/path_provider/path_provider/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.pathproviderexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/path_provider/path_provider_android/CHANGELOG.md b/packages/path_provider/path_provider_android/CHANGELOG.md index 379fd5c4a76..660b3fa5498 100644 --- a/packages/path_provider/path_provider_android/CHANGELOG.md +++ b/packages/path_provider/path_provider_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.26 + +* Adds a namespace for compatibility with AGP 8.0. + ## 2.0.25 * Fixes Java warnings. diff --git a/packages/path_provider/path_provider_android/android/build.gradle b/packages/path_provider/path_provider_android/android/build.gradle index 1fbfa8b76f6..09b407a5363 100644 --- a/packages/path_provider/path_provider_android/android/build.gradle +++ b/packages/path_provider/path_provider_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.pathprovider' compileSdkVersion 33 defaultConfig { diff --git a/packages/path_provider/path_provider_android/example/android/app/build.gradle b/packages/path_provider/path_provider_android/example/android/app/build.gradle index fea015334ab..f0e38191162 100644 --- a/packages/path_provider/path_provider_android/example/android/app/build.gradle +++ b/packages/path_provider/path_provider_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.pathproviderexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/path_provider/path_provider_android/pubspec.yaml b/packages/path_provider/path_provider_android/pubspec.yaml index 781b80899fa..95300b1f612 100644 --- a/packages/path_provider/path_provider_android/pubspec.yaml +++ b/packages/path_provider/path_provider_android/pubspec.yaml @@ -2,7 +2,7 @@ name: path_provider_android description: Android implementation of the path_provider plugin. repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 -version: 2.0.25 +version: 2.0.26 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle index 91feeb1d573..fd7668d01b8 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'com.example.alternate_language_test_plugin' compileSdkVersion 33 compileOptions { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle index 4ce69f6d2b4..9f01f9bdb6b 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'com.example.alternate_language_test_plugin_example' compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/packages/pigeon/platform_tests/test_plugin/android/build.gradle b/packages/pigeon/platform_tests/test_plugin/android/build.gradle index 2703f620e78..cb1f555d38a 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/android/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.example.test_plugin' compileSdkVersion 33 compileOptions { diff --git a/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle b/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle index 01008145b94..ff91598737f 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'com.example.test_plugin_example' compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion diff --git a/packages/quick_actions/quick_actions/example/android/app/build.gradle b/packages/quick_actions/quick_actions/example/android/app/build.gradle index cf9dae47ec1..335a77a39bb 100644 --- a/packages/quick_actions/quick_actions/example/android/app/build.gradle +++ b/packages/quick_actions/quick_actions/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.quickactionsexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/quick_actions/quick_actions_android/CHANGELOG.md b/packages/quick_actions/quick_actions_android/CHANGELOG.md index bea687fffcb..3187f6aaebb 100644 --- a/packages/quick_actions/quick_actions_android/CHANGELOG.md +++ b/packages/quick_actions/quick_actions_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.3 + +* Adds a namespace for compatibility with AGP 8.0. + ## 1.0.2 * Clarifies explanation of endorsement in README. diff --git a/packages/quick_actions/quick_actions_android/android/build.gradle b/packages/quick_actions/quick_actions_android/android/build.gradle index a668fb05387..935c5176c27 100644 --- a/packages/quick_actions/quick_actions_android/android/build.gradle +++ b/packages/quick_actions/quick_actions_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.quickactions' compileSdkVersion 33 defaultConfig { diff --git a/packages/quick_actions/quick_actions_android/example/android/app/build.gradle b/packages/quick_actions/quick_actions_android/example/android/app/build.gradle index 0c9500cb8da..6fc3dbe1b26 100644 --- a/packages/quick_actions/quick_actions_android/example/android/app/build.gradle +++ b/packages/quick_actions/quick_actions_android/example/android/app/build.gradle @@ -27,6 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" def androidXTestVersion = '1.2.0' android { + namespace 'io.flutter.plugins.quickactionsexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/quick_actions/quick_actions_android/pubspec.yaml b/packages/quick_actions/quick_actions_android/pubspec.yaml index f59f99cee8c..ca16d8bda96 100644 --- a/packages/quick_actions/quick_actions_android/pubspec.yaml +++ b/packages/quick_actions/quick_actions_android/pubspec.yaml @@ -2,7 +2,7 @@ name: quick_actions_android description: An implementation for the Android platform of the Flutter `quick_actions` plugin. repository: https://github.com/flutter/packages/tree/main/packages/quick_actions/quick_actions_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 1.0.2 +version: 1.0.3 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/rfw/example/hello/android/app/build.gradle b/packages/rfw/example/hello/android/app/build.gradle index 85145132bbb..7c6ac085935 100644 --- a/packages/rfw/example/hello/android/app/build.gradle +++ b/packages/rfw/example/hello/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'dev.flutter.rfw.examples.hello' compileSdkVersion flutter.compileSdkVersion compileOptions { diff --git a/packages/rfw/example/hello/android/build.gradle b/packages/rfw/example/hello/android/build.gradle index 27ef0fc4b02..ff27ef813e9 100644 --- a/packages/rfw/example/hello/android/build.gradle +++ b/packages/rfw/example/hello/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -24,6 +24,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties b/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties index bc6a58afdda..6b665338b34 100644 --- a/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/rfw/example/local/android/app/build.gradle b/packages/rfw/example/local/android/app/build.gradle index 0948e02dd49..ff877b9fd20 100644 --- a/packages/rfw/example/local/android/app/build.gradle +++ b/packages/rfw/example/local/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'dev.flutter.rfw.examples.local' compileSdkVersion flutter.compileSdkVersion compileOptions { diff --git a/packages/rfw/example/local/android/build.gradle b/packages/rfw/example/local/android/build.gradle index 27ef0fc4b02..ff27ef813e9 100644 --- a/packages/rfw/example/local/android/build.gradle +++ b/packages/rfw/example/local/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -24,6 +24,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties b/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties index bc6a58afdda..6b665338b34 100644 --- a/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/rfw/example/remote/android/app/build.gradle b/packages/rfw/example/remote/android/app/build.gradle index 06c0f4b3ae7..05c97c07447 100644 --- a/packages/rfw/example/remote/android/app/build.gradle +++ b/packages/rfw/example/remote/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'dev.flutter.rfw.examples.remote' compileSdkVersion flutter.compileSdkVersion compileOptions { diff --git a/packages/rfw/example/remote/android/build.gradle b/packages/rfw/example/remote/android/build.gradle index 27ef0fc4b02..ff27ef813e9 100644 --- a/packages/rfw/example/remote/android/build.gradle +++ b/packages/rfw/example/remote/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -24,6 +24,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties b/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties index bc6a58afdda..6b665338b34 100644 --- a/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/shared_preferences/shared_preferences/example/android/app/build.gradle b/packages/shared_preferences/shared_preferences/example/android/app/build.gradle index f89ec33a7b3..290981f065e 100644 --- a/packages/shared_preferences/shared_preferences/example/android/app/build.gradle +++ b/packages/shared_preferences/shared_preferences/example/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.sharedpreferencesexample' compileSdkVersion flutter.compileSdkVersion sourceSets { diff --git a/packages/shared_preferences/shared_preferences_android/CHANGELOG.md b/packages/shared_preferences/shared_preferences_android/CHANGELOG.md index def89d10128..a14bc1d7fe6 100644 --- a/packages/shared_preferences/shared_preferences_android/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.3 + +* Adds a namespace for compatibility with AGP 8.0. + ## 2.1.2 * Sets the required Java compile version to 1.8 for new features used in 2.1.1. diff --git a/packages/shared_preferences/shared_preferences_android/android/build.gradle b/packages/shared_preferences/shared_preferences_android/android/build.gradle index e2e68582c45..4469e49bf73 100644 --- a/packages/shared_preferences/shared_preferences_android/android/build.gradle +++ b/packages/shared_preferences/shared_preferences_android/android/build.gradle @@ -30,6 +30,7 @@ allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.sharedpreferences' compileSdkVersion 33 compileOptions { diff --git a/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle b/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle index f89ec33a7b3..290981f065e 100644 --- a/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle +++ b/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle @@ -26,6 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.sharedpreferencesexample' compileSdkVersion flutter.compileSdkVersion sourceSets { diff --git a/packages/shared_preferences/shared_preferences_android/pubspec.yaml b/packages/shared_preferences/shared_preferences_android/pubspec.yaml index a6608a66ca6..e9381f4d16c 100644 --- a/packages/shared_preferences/shared_preferences_android/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_android/pubspec.yaml @@ -2,7 +2,7 @@ name: shared_preferences_android description: Android implementation of the shared_preferences plugin repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 -version: 2.1.2 +version: 2.1.3 environment: sdk: ">=2.17.0 <4.0.0" diff --git a/packages/url_launcher/url_launcher/example/android/app/build.gradle b/packages/url_launcher/url_launcher/example/android/app/build.gradle index afc68883719..3f1897c6b95 100644 --- a/packages/url_launcher/url_launcher/example/android/app/build.gradle +++ b/packages/url_launcher/url_launcher/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.urllauncherexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index 3e46aa92885..e75e9d04c4f 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.0.29 + +* Adds a namespace for compatibility with AGP 8.0. + ## 6.0.28 * Sets an explicit Java compatibility version. diff --git a/packages/url_launcher/url_launcher_android/android/build.gradle b/packages/url_launcher/url_launcher_android/android/build.gradle index 8b4abcc1996..d371a802cb8 100644 --- a/packages/url_launcher/url_launcher_android/android/build.gradle +++ b/packages/url_launcher/url_launcher_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.urllauncher' compileSdkVersion 33 defaultConfig { diff --git a/packages/url_launcher/url_launcher_android/example/android/app/build.gradle b/packages/url_launcher/url_launcher_android/example/android/app/build.gradle index afc68883719..3f1897c6b95 100644 --- a/packages/url_launcher/url_launcher_android/example/android/app/build.gradle +++ b/packages/url_launcher/url_launcher_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.urllauncherexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 505fdfaf27b..5a9de34b90e 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_android description: Android implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.0.28 +version: 6.0.29 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/video_player/video_player/example/android/app/build.gradle b/packages/video_player/video_player/example/android/app/build.gradle index 8936f2b7542..0cc4b67e13a 100644 --- a/packages/video_player/video_player/example/android/app/build.gradle +++ b/packages/video_player/video_player/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.videoplayerexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md index 7dbfe5da66e..3a60162d2af 100644 --- a/packages/video_player/video_player_android/CHANGELOG.md +++ b/packages/video_player/video_player_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.5 + +* Adds a namespace for compatibility with AGP 8.0. + ## 2.4.4 * Synchronizes `VideoPlayerValue.isPlaying` with `ExoPlayer`. diff --git a/packages/video_player/video_player_android/android/build.gradle b/packages/video_player/video_player_android/android/build.gradle index 9145f6c8b31..0facb26f51b 100644 --- a/packages/video_player/video_player_android/android/build.gradle +++ b/packages/video_player/video_player_android/android/build.gradle @@ -27,6 +27,7 @@ project.getTasks().withType(JavaCompile){ apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.videoplayer' compileSdkVersion 33 defaultConfig { diff --git a/packages/video_player/video_player_android/example/android/app/build.gradle b/packages/video_player/video_player_android/example/android/app/build.gradle index 0eba9c8bd64..30fb2c0f2dd 100644 --- a/packages/video_player/video_player_android/example/android/app/build.gradle +++ b/packages/video_player/video_player_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.videoplayerexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/video_player/video_player_android/pubspec.yaml b/packages/video_player/video_player_android/pubspec.yaml index a77b6463f15..7940829efa5 100644 --- a/packages/video_player/video_player_android/pubspec.yaml +++ b/packages/video_player/video_player_android/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_android description: Android implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.4.4 +version: 2.4.5 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/packages/webview_flutter/webview_flutter/example/android/app/build.gradle b/packages/webview_flutter/webview_flutter/example/android/app/build.gradle index 734a2531610..c52fd85efac 100644 --- a/packages/webview_flutter/webview_flutter/example/android/app/build.gradle +++ b/packages/webview_flutter/webview_flutter/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.webviewflutterexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index 14b0ec9bd9a..137f882349e 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.6.1 + +* Adds a namespace for compatibility with AGP 8.0. + ## 3.6.0 * Adds support for `PlatformWebViewController.setOnPlatformPermissionRequest`. diff --git a/packages/webview_flutter/webview_flutter_android/android/build.gradle b/packages/webview_flutter/webview_flutter_android/android/build.gradle index 08a94f4450b..13eff1a9bed 100644 --- a/packages/webview_flutter/webview_flutter_android/android/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/android/build.gradle @@ -22,6 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace 'io.flutter.plugins.webviewflutter' compileSdkVersion 33 defaultConfig { diff --git a/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle b/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle index fdda69615c8..82af0bd223e 100644 --- a/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace 'io.flutter.plugins.webviewflutterexample' compileSdkVersion flutter.compileSdkVersion lintOptions { diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index 9accd85746a..94105ff3b44 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_android description: A Flutter plugin that provides a WebView widget on Android. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 3.6.0 +version: 3.6.1 environment: sdk: ">=2.18.0 <4.0.0" diff --git a/script/tool/lib/src/gradle_check_command.dart b/script/tool/lib/src/gradle_check_command.dart index 734180c1f27..75263b20230 100644 --- a/script/tool/lib/src/gradle_check_command.dart +++ b/script/tool/lib/src/gradle_check_command.dart @@ -36,31 +36,169 @@ class GradleCheckCommand extends PackageLoopingCommand { const String exampleDirName = 'example'; final bool isExample = package.directory.basename == exampleDirName || package.directory.parent.basename == exampleDirName; - if (!_validateBuildGradle(package, isExample: isExample)) { + if (!_validateBuildGradles(package, isExample: isExample)) { return PackageResult.fail(); } return PackageResult.success(); } - bool _validateBuildGradle(RepositoryPackage package, + bool _validateBuildGradles(RepositoryPackage package, {required bool isExample}) { - // Currently the only check is not relevant to examples; checks that apply - // to both plugins and examples should go above here. - if (!isExample) { - print('${indentation}Validating android/build.gradle.'); - final String contents = package - .platformDirectory(FlutterPlatform.android) - .childFile('build.gradle') - .readAsStringSync(); - final List lines = contents.split('\n'); - - if (!lines.any((String line) => - line.contains('languageVersion') && - !line.trim().startsWith('//')) && - !lines.any((String line) => - line.contains('sourceCompatibility') && - !line.trim().startsWith('//'))) { - const String errorMessage = ''' + final Directory androidDir = + package.platformDirectory(FlutterPlatform.android); + final File topLevelGradleFile = _getBuildGradleFile(androidDir); + + // This is tracked as a variable rather than a sequence of &&s so that all + // failures are reported at once, not just the first one. + bool succeeded = true; + if (isExample) { + if (!_validateExampleTopLevelBuildGradle(package, topLevelGradleFile)) { + succeeded = false; + } + + final File appGradleFile = + _getBuildGradleFile(androidDir.childDirectory('app')); + if (!_validateExampleAppBuildGradle(package, appGradleFile)) { + succeeded = false; + } + } else { + succeeded = _validatePluginBuildGradle(package, topLevelGradleFile); + } + + return succeeded; + } + + // Returns the gradle file in the given directory. + File _getBuildGradleFile(Directory dir) => dir.childFile('build.gradle'); + + // Returns the main/AndroidManifest.xml file for the given package. + File _getMainAndroidManifest(RepositoryPackage package, + {required bool isExample}) { + final Directory androidDir = + package.platformDirectory(FlutterPlatform.android); + final Directory baseDir = + isExample ? androidDir.childDirectory('app') : androidDir; + return baseDir + .childDirectory('src') + .childDirectory('main') + .childFile('AndroidManifest.xml'); + } + + /// Validates the build.gradle file for a plugin + /// (some_plugin/android/build.gradle). + bool _validatePluginBuildGradle(RepositoryPackage package, File gradleFile) { + print('${indentation}Validating ' + '${getRelativePosixPath(gradleFile, from: package.directory)}.'); + final String contents = gradleFile.readAsStringSync(); + final List lines = contents.split('\n'); + + // This is tracked as a variable rather than a sequence of &&s so that all + // failures are reported at once, not just the first one. + bool succeeded = true; + if (!_validateNamespace(package, contents, isExample: false)) { + succeeded = false; + } + if (!_validateSourceCompatibilityVersion(lines)) { + succeeded = false; + } + return succeeded; + } + + /// Validates the top-level build.gradle for an example app (e.g., + /// some_package/example/android/build.gradle). + bool _validateExampleTopLevelBuildGradle( + RepositoryPackage package, File gradleFile) { + print('${indentation}Validating ' + '${getRelativePosixPath(gradleFile, from: package.directory)}.'); + // TODO(stuartmorgan): Move the -Xlint validation from lint_android_command + // to here. + return true; + } + + /// Validates the app-level build.gradle for an example app (e.g., + /// some_package/example/android/app/build.gradle). + bool _validateExampleAppBuildGradle( + RepositoryPackage package, File gradleFile) { + print('${indentation}Validating ' + '${getRelativePosixPath(gradleFile, from: package.directory)}.'); + final String contents = gradleFile.readAsStringSync(); + + // This is tracked as a variable rather than a sequence of &&s so that all + // failures are reported at once, not just the first one. + bool succeeded = true; + if (!_validateNamespace(package, contents, isExample: true)) { + succeeded = false; + } + return succeeded; + } + + /// Validates that [gradleContents] sets a namespace, which is required for + /// compatibility with apps that use AGP 8+. + bool _validateNamespace(RepositoryPackage package, String gradleContents, + {required bool isExample}) { + final RegExp namespaceRegex = + RegExp('^\\s*namespace\\s+[\'"](.*?)[\'"]', multiLine: true); + final RegExpMatch? namespaceMatch = + namespaceRegex.firstMatch(gradleContents); + if (namespaceMatch == null) { + const String errorMessage = ''' +build.gradle must set a "namespace": + + android { + namespace 'dev.flutter.foo' + } + +The value must match the "package" attribute in AndroidManifest.xml, if one is +present. For more information, see: +https://developer.android.com/build/publish-library/prep-lib-release#choose-namespace +'''; + + printError( + '$indentation${errorMessage.split('\n').join('\n$indentation')}'); + return false; + } else { + return _validateNamespaceMatchesManifest(package, + isExample: isExample, namespace: namespaceMatch.group(1)!); + } + } + + /// Validates that the given namespace matches the manifest package of + /// [package] (if any; a package does not need to be in the manifest in cases + /// where compatibility with AGP <7 is no longer required). + /// + /// Prints an error and returns false if validation fails. + bool _validateNamespaceMatchesManifest(RepositoryPackage package, + {required bool isExample, required String namespace}) { + final RegExp manifestPackageRegex = RegExp(r'package\s*=\s*"(.*?)"'); + final String manifestContents = + _getMainAndroidManifest(package, isExample: isExample) + .readAsStringSync(); + final RegExpMatch? packageMatch = + manifestPackageRegex.firstMatch(manifestContents); + if (packageMatch != null && namespace != packageMatch.group(1)) { + final String errorMessage = ''' +build.gradle "namespace" must match the "package" attribute in AndroidManifest.xml, if one is present. + build.gradle namespace: "$namespace" + AndroidMastifest.xml package: "${packageMatch.group(1)}" +'''; + printError( + '$indentation${errorMessage.split('\n').join('\n$indentation')}'); + return false; + } + return true; + } + + /// Checks for a source compatibiltiy version, so that it's explicit rather + /// than using whatever the client's local toolchaing defaults to (which can + /// lead to compile errors that show up for clients, but not in CI). + bool _validateSourceCompatibilityVersion(List gradleLines) { + if (!gradleLines.any((String line) => + line.contains('languageVersion') && + !line.trim().startsWith('//')) && + !gradleLines.any((String line) => + line.contains('sourceCompatibility') && + !line.trim().startsWith('//'))) { + const String errorMessage = ''' build.gradle must set an explicit Java compatibility version. This can be done either via "sourceCompatibility": @@ -81,12 +219,10 @@ See: https://docs.gradle.org/current/userguide/java_plugin.html#toolchain_and_compatibility for more details.'''; - printError( - '$indentation${errorMessage.split('\n').join('\n$indentation')}'); - return false; - } + printError( + '$indentation${errorMessage.split('\n').join('\n$indentation')}'); + return false; } - return true; } } diff --git a/script/tool/test/gradle_check_command_test.dart b/script/tool/test/gradle_check_command_test.dart index e7a4b2b9cb1..a3a482d762d 100644 --- a/script/tool/test/gradle_check_command_test.dart +++ b/script/tool/test/gradle_check_command_test.dart @@ -11,6 +11,8 @@ import 'package:test/test.dart'; import 'util.dart'; +const String _defaultFakeNamespace = 'dev.flutter.foo'; + void main() { late CommandRunner runner; late FileSystem fileSystem; @@ -31,28 +33,35 @@ void main() { void writeFakeBuildGradle( RepositoryPackage package, { + bool isApp = false, bool includeLanguageVersion = false, bool includeSourceCompat = false, - bool commentRequiredLine = false, + bool commentSourceLanguage = false, + bool includeNamespace = true, + bool commentNamespace = false, }) { - final File buildGradle = package - .platformDirectory(FlutterPlatform.android) - .childFile('build.gradle'); + final Directory androidDir = + package.platformDirectory(FlutterPlatform.android); + final Directory parentDir = + isApp ? androidDir.childDirectory('app') : androidDir; + final File buildGradle = parentDir.childFile('build.gradle'); buildGradle.createSync(recursive: true); final String compileOptionsSection = ''' compileOptions { - ${commentRequiredLine ? '// ' : ''}sourceCompatibility JavaVersion.VERSION_1_8 + ${commentSourceLanguage ? '// ' : ''}sourceCompatibility JavaVersion.VERSION_1_8 } '''; final String javaSection = ''' java { toolchain { - ${commentRequiredLine ? '// ' : ''}languageVersion = JavaLanguageVersion.of(8) + ${commentSourceLanguage ? '// ' : ''}languageVersion = JavaLanguageVersion.of(8) } } '''; + final String namespace = + "${commentNamespace ? '// ' : ''}namespace '$_defaultFakeNamespace'"; buildGradle.writeAsStringSync(''' group 'dev.flutter.plugins.fake' @@ -69,6 +78,7 @@ apply plugin: 'com.android.library' ${includeLanguageVersion ? javaSection : ''} android { + ${includeNamespace ? namespace : ''} compileSdkVersion 33 defaultConfig { @@ -89,6 +99,26 @@ dependencies { '''); } + void writeFakeManifest( + RepositoryPackage package, { + bool isApp = false, + String packageName = _defaultFakeNamespace, + }) { + final Directory androidDir = + package.platformDirectory(FlutterPlatform.android); + final Directory startDir = + isApp ? androidDir.childDirectory('app') : androidDir; + final File manifest = startDir + .childDirectory('src') + .childDirectory('main') + .childFile('AndroidManifest.xml'); + manifest.createSync(recursive: true); + manifest.writeAsString(''' + +'''); + } + test('skips when package has no Android directory', () async { createFakePackage('a_package', packagesDir, examples: []); @@ -107,6 +137,7 @@ dependencies { final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir, examples: []); writeFakeBuildGradle(package); + writeFakeManifest(package); Error? commandError; final List output = await runCapturingPrint( @@ -128,6 +159,7 @@ dependencies { final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir, examples: []); writeFakeBuildGradle(package, includeSourceCompat: true); + writeFakeManifest(package); final List output = await runCapturingPrint(runner, ['gradle-check']); @@ -144,6 +176,7 @@ dependencies { final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir, examples: []); writeFakeBuildGradle(package, includeLanguageVersion: true); + writeFakeManifest(package); final List output = await runCapturingPrint(runner, ['gradle-check']); @@ -159,7 +192,10 @@ dependencies { test('does not require java version in examples', () async { final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir); writeFakeBuildGradle(package, includeLanguageVersion: true); - writeFakeBuildGradle(package.getExamples().first); + writeFakeManifest(package); + final RepositoryPackage example = package.getExamples().first; + writeFakeBuildGradle(example, isApp: true); + writeFakeManifest(example, isApp: true); final List output = await runCapturingPrint(runner, ['gradle-check']); @@ -177,7 +213,8 @@ dependencies { final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir, examples: []); writeFakeBuildGradle(package, - includeSourceCompat: true, commentRequiredLine: true); + includeSourceCompat: true, commentSourceLanguage: true); + writeFakeManifest(package); Error? commandError; final List output = await runCapturingPrint( @@ -199,7 +236,8 @@ dependencies { final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir, examples: []); writeFakeBuildGradle(package, - includeLanguageVersion: true, commentRequiredLine: true); + includeLanguageVersion: true, commentSourceLanguage: true); + writeFakeManifest(package); Error? commandError; final List output = await runCapturingPrint( @@ -216,4 +254,124 @@ dependencies { ]), ); }); + + test('fails when plugin namespace does not match AndroidManifest.xml', + () async { + final RepositoryPackage package = + createFakePlugin('a_plugin', packagesDir, examples: []); + writeFakeBuildGradle(package, includeLanguageVersion: true); + writeFakeManifest(package, packageName: 'wrong.package.name'); + + Error? commandError; + final List output = await runCapturingPrint( + runner, ['gradle-check'], errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder([ + contains( + 'build.gradle "namespace" must match the "package" attribute in AndroidManifest.xml'), + ]), + ); + }); + + test('fails when namespace is missing', () async { + final RepositoryPackage package = + createFakePlugin('a_plugin', packagesDir, examples: []); + writeFakeBuildGradle(package, + includeLanguageVersion: true, includeNamespace: false); + writeFakeManifest(package); + + Error? commandError; + final List output = await runCapturingPrint( + runner, ['gradle-check'], errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder([ + contains('build.gradle must set a "namespace"'), + ]), + ); + }); + + test('fails when namespace is missing from example', () async { + final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir); + writeFakeBuildGradle(package, includeLanguageVersion: true); + writeFakeManifest(package); + final RepositoryPackage example = package.getExamples().first; + writeFakeBuildGradle(example, + isApp: true, includeLanguageVersion: true, includeNamespace: false); + writeFakeManifest(example, isApp: true); + + Error? commandError; + final List output = await runCapturingPrint( + runner, ['gradle-check'], errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder([ + contains('build.gradle must set a "namespace"'), + ]), + ); + }); + + // TODO(stuartmorgan): Consider removing this in the future; we may at some + // point decide that we have a use case of example apps having different + // app IDs and namespaces. For now, it's enforced for consistency so they + // don't just accidentally diverge. + test('fails when namespace in example does not match AndroidManifest.xml', + () async { + final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir); + writeFakeBuildGradle(package, includeLanguageVersion: true); + writeFakeManifest(package); + final RepositoryPackage example = package.getExamples().first; + writeFakeBuildGradle(example, isApp: true, includeLanguageVersion: true); + writeFakeManifest(example, isApp: true, packageName: 'wrong.package.name'); + + Error? commandError; + final List output = await runCapturingPrint( + runner, ['gradle-check'], errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder([ + contains( + 'build.gradle "namespace" must match the "package" attribute in AndroidManifest.xml'), + ]), + ); + }); + + test('fails when namespace is commented out', () async { + final RepositoryPackage package = + createFakePlugin('a_plugin', packagesDir, examples: []); + writeFakeBuildGradle(package, + includeLanguageVersion: true, commentNamespace: true); + writeFakeManifest(package); + + Error? commandError; + final List output = await runCapturingPrint( + runner, ['gradle-check'], errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder([ + contains('build.gradle must set a "namespace"'), + ]), + ); + }); }