Skip to content

Commit b552906

Browse files
reidbakergmackall
andauthored
Set java 11 as expected java version in all templates (#160349)
Bump templates from java 8 to java 11. fixes flutter/flutter#156111 I want to talk to @gmackall before merging to talk through the consequences. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. --------- Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
1 parent cda3515 commit b552906

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

packages/flutter_tools/templates/app/android-java.tmpl/app/build.gradle.kts.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ android {
1111
ndkVersion = flutter.ndkVersion
1212

1313
compileOptions {
14-
sourceCompatibility = JavaVersion.VERSION_1_8
15-
targetCompatibility = JavaVersion.VERSION_1_8
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
1616
}
1717

1818
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_1_8.toString()
19+
jvmTarget = JavaVersion.VERSION_11.toString()
2020
}
2121

2222
defaultConfig {

packages/flutter_tools/templates/app/android-kotlin.tmpl/app/build.gradle.kts.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ android {
1111
ndkVersion = flutter.ndkVersion
1212

1313
compileOptions {
14-
sourceCompatibility = JavaVersion.VERSION_1_8
15-
targetCompatibility = JavaVersion.VERSION_1_8
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
1616
}
1717

1818
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_1_8.toString()
19+
jvmTarget = JavaVersion.VERSION_11.toString()
2020
}
2121

2222
defaultConfig {

packages/flutter_tools/templates/module/android/deferred_component/build.gradle.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ android {
2323
compileSdk = flutter.compileSdkVersion
2424

2525
compileOptions {
26-
sourceCompatibility = JavaVersion.VERSION_1_8
27-
targetCompatibility = JavaVersion.VERSION_1_8
26+
sourceCompatibility = JavaVersion.VERSION_11
27+
targetCompatibility = JavaVersion.VERSION_11
2828
}
2929

3030
sourceSets {

packages/flutter_tools/templates/module/android/host_app_common/app.tmpl/build.gradle.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
compileSdk = {{compileSdkVersion}}
88

99
compileOptions {
10-
sourceCompatibility = JavaVersion.VERSION_1_8
11-
targetCompatibility = JavaVersion.VERSION_1_8
10+
sourceCompatibility = JavaVersion.VERSION_11
11+
targetCompatibility = JavaVersion.VERSION_11
1212
}
1313

1414
defaultConfig {

packages/flutter_tools/templates/module/android/library_new_embedding/Flutter.tmpl/build.gradle.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ android {
3232
ndkVersion = flutter.ndkVersion
3333

3434
compileOptions {
35-
sourceCompatibility = JavaVersion.VERSION_1_8
36-
targetCompatibility = JavaVersion.VERSION_1_8
35+
sourceCompatibility = JavaVersion.VERSION_11
36+
targetCompatibility = JavaVersion.VERSION_11
3737
}
3838

3939
defaultConfig {

0 commit comments

Comments
 (0)