Update Android plugin templates for newer AGP (#156533)
Now that Flutter requires AGP 7+, we can use Java 11 as the compatibility version in the plugin template rather than 1.8, avoiding warnings with newer toolchains, and we can remove the check for 'namespace' existing that was only necessary to support AGP 4.1. See also https://github.com/flutter/packages/pull/7795 which made this change in Flutter-team-owned plugins. Part of https://github.com/flutter/flutter/issues/156111
This commit is contained in:
@@ -22,15 +22,13 @@ rootProject.allprojects {
|
||||
apply plugin: "com.android.library"
|
||||
|
||||
android {
|
||||
if (project.android.hasProperty("namespace")) {
|
||||
namespace = "{{androidIdentifier}}"
|
||||
}
|
||||
namespace = "{{androidIdentifier}}"
|
||||
|
||||
compileSdk = {{compileSdkVersion}}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
||||
@@ -25,19 +25,17 @@ apply plugin: "com.android.library"
|
||||
apply plugin: "kotlin-android"
|
||||
|
||||
android {
|
||||
if (project.android.hasProperty("namespace")) {
|
||||
namespace = "{{androidIdentifier}}"
|
||||
}
|
||||
namespace = "{{androidIdentifier}}"
|
||||
|
||||
compileSdk = {{compileSdkVersion}}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8
|
||||
jvmTarget = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -25,9 +25,7 @@ rootProject.allprojects {
|
||||
apply plugin: "com.android.library"
|
||||
|
||||
android {
|
||||
if (project.android.hasProperty("namespace")) {
|
||||
namespace = "{{androidIdentifier}}"
|
||||
}
|
||||
namespace = "{{androidIdentifier}}"
|
||||
|
||||
// Bumping the plugin compileSdk version requires all clients of this plugin
|
||||
// to bump the version in their app.
|
||||
@@ -55,8 +53,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
||||
Reference in New Issue
Block a user