From abadfb54fc7aa327ae6ca0b5a928b2cff194db5c Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 4 Nov 2024 17:06:27 -0500 Subject: [PATCH] [various] Update example apps to Kotlin 1.9.0 (#7998) Follow-up to https://github.com/flutter/packages/pull/7997 to update all example apps to 1.9.0 to protect us from similar OOB failures as other transitive dependencies in the ecosystem update to newer versions of Kotlin. --- packages/animations/example/android/app/build.gradle | 9 +++++++++ packages/animations/example/android/build.gradle | 2 +- .../camera_android_camerax/example/android/build.gradle | 5 +---- .../file_selector/example/android/settings.gradle | 2 +- .../example/android/settings.gradle | 2 +- .../example/android/build.gradle | 2 +- packages/flutter_image/example/android/build.gradle | 2 +- .../flutter_markdown/example/android/app/build.gradle | 9 +++++++++ packages/flutter_markdown/example/android/build.gradle | 2 +- packages/pigeon/example/app/android/build.gradle | 2 +- .../example/android/build.gradle | 2 +- .../test_plugin/example/android/build.gradle | 2 +- packages/rfw/example/hello/android/build.gradle | 2 +- packages/rfw/example/local/android/build.gradle | 2 +- packages/rfw/example/remote/android/build.gradle | 2 +- .../shared_preferences/example/android/build.gradle | 2 +- .../example/android/build.gradle | 2 +- .../example/android/settings.gradle | 2 +- .../flutter_svg/example/android/app/build.gradle | 9 +++++++++ .../packages/flutter_svg/example/android/build.gradle | 2 +- 20 files changed, 44 insertions(+), 20 deletions(-) diff --git a/packages/animations/example/android/app/build.gradle b/packages/animations/example/android/app/build.gradle index f807599056dc..19d11f91e671 100644 --- a/packages/animations/example/android/app/build.gradle +++ b/packages/animations/example/android/app/build.gradle @@ -29,6 +29,15 @@ android { namespace 'dev.flutter.packages.animations.example' compileSdk flutter.compileSdkVersion + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = '11' + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' } diff --git a/packages/animations/example/android/build.gradle b/packages/animations/example/android/build.gradle index 491936f2fbef..4a9ad584b421 100644 --- a/packages/animations/example/android/build.gradle +++ b/packages/animations/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/camera/camera_android_camerax/example/android/build.gradle b/packages/camera/camera_android_camerax/example/android/build.gradle index 450abce36d28..7ad575841c0e 100644 --- a/packages/camera/camera_android_camerax/example/android/build.gradle +++ b/packages/camera/camera_android_camerax/example/android/build.gradle @@ -1,8 +1,5 @@ buildscript { - // This version should intentionally be a 1.7.* version and lower than the - // version of kotlin-bom defined in packages/camera/camera_android_camerax/android/build.gradle. - // This tests that the kotlin version resolution continues to work. - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/file_selector/file_selector/example/android/settings.gradle b/packages/file_selector/file_selector/example/android/settings.gradle index 93c30cf9a776..d056e4db3665 100644 --- a/packages/file_selector/file_selector/example/android/settings.gradle +++ b/packages/file_selector/file_selector/example/android/settings.gradle @@ -20,7 +20,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.5.1" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "org.jetbrains.kotlin.android" version "1.9.0" apply false id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.1" } diff --git a/packages/file_selector/file_selector_android/example/android/settings.gradle b/packages/file_selector/file_selector_android/example/android/settings.gradle index 2bb2ce926809..74d52ff12f4f 100644 --- a/packages/file_selector/file_selector_android/example/android/settings.gradle +++ b/packages/file_selector/file_selector_android/example/android/settings.gradle @@ -20,7 +20,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.5.2" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "org.jetbrains.kotlin.android" version "1.9.0" apply false id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.1" } diff --git a/packages/flutter_adaptive_scaffold/example/android/build.gradle b/packages/flutter_adaptive_scaffold/example/android/build.gradle index 5cf1eb221426..510b513a8157 100644 --- a/packages/flutter_adaptive_scaffold/example/android/build.gradle +++ b/packages/flutter_adaptive_scaffold/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/flutter_image/example/android/build.gradle b/packages/flutter_image/example/android/build.gradle index 491936f2fbef..4a9ad584b421 100644 --- a/packages/flutter_image/example/android/build.gradle +++ b/packages/flutter_image/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/flutter_markdown/example/android/app/build.gradle b/packages/flutter_markdown/example/android/app/build.gradle index e542c8f72cb3..6b8f51a79916 100644 --- a/packages/flutter_markdown/example/android/app/build.gradle +++ b/packages/flutter_markdown/example/android/app/build.gradle @@ -28,6 +28,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdk flutter.compileSdkVersion + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = '11' + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' } diff --git a/packages/flutter_markdown/example/android/build.gradle b/packages/flutter_markdown/example/android/build.gradle index 0501e9227a37..6f6453aefc39 100644 --- a/packages/flutter_markdown/example/android/build.gradle +++ b/packages/flutter_markdown/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/pigeon/example/app/android/build.gradle b/packages/pigeon/example/app/android/build.gradle index 491936f2fbef..4a9ad584b421 100644 --- a/packages/pigeon/example/app/android/build.gradle +++ b/packages/pigeon/example/app/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle index 0b4ac7621f18..3da672414966 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle b/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle index b7ab9808de13..6daa2e734aef 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/rfw/example/hello/android/build.gradle b/packages/rfw/example/hello/android/build.gradle index cd70ddd54b1e..ab596dbe21c5 100644 --- a/packages/rfw/example/hello/android/build.gradle +++ b/packages/rfw/example/hello/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/rfw/example/local/android/build.gradle b/packages/rfw/example/local/android/build.gradle index fa0c3b56c2a4..aae66ee04e46 100644 --- a/packages/rfw/example/local/android/build.gradle +++ b/packages/rfw/example/local/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/rfw/example/remote/android/build.gradle b/packages/rfw/example/remote/android/build.gradle index 31b11cccd4e1..13648db310e1 100644 --- a/packages/rfw/example/remote/android/build.gradle +++ b/packages/rfw/example/remote/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/shared_preferences/shared_preferences/example/android/build.gradle b/packages/shared_preferences/shared_preferences/example/android/build.gradle index 5cf1eb221426..510b513a8157 100644 --- a/packages/shared_preferences/shared_preferences/example/android/build.gradle +++ b/packages/shared_preferences/shared_preferences/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/shared_preferences/shared_preferences_android/example/android/build.gradle b/packages/shared_preferences/shared_preferences_android/example/android/build.gradle index bd044999632d..1e044b317097 100644 --- a/packages/shared_preferences/shared_preferences_android/example/android/build.gradle +++ b/packages/shared_preferences/shared_preferences_android/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.8.10' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() diff --git a/packages/two_dimensional_scrollables/example/android/settings.gradle b/packages/two_dimensional_scrollables/example/android/settings.gradle index a989e8eb35b4..0667903d5724 100644 --- a/packages/two_dimensional_scrollables/example/android/settings.gradle +++ b/packages/two_dimensional_scrollables/example/android/settings.gradle @@ -20,7 +20,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.5.2" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "org.jetbrains.kotlin.android" version "1.9.0" apply false id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.1" } diff --git a/third_party/packages/flutter_svg/example/android/app/build.gradle b/third_party/packages/flutter_svg/example/android/app/build.gradle index 5e2905dee5f0..0a6e4fe90bb3 100644 --- a/third_party/packages/flutter_svg/example/android/app/build.gradle +++ b/third_party/packages/flutter_svg/example/android/app/build.gradle @@ -29,6 +29,15 @@ android { namespace 'io.flutter.plugins.fluttersvgexample' compileSdkVersion flutter.compileSdkVersion + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = '11' + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' } diff --git a/third_party/packages/flutter_svg/example/android/build.gradle b/third_party/packages/flutter_svg/example/android/build.gradle index bec9397fd529..571f15900e8f 100644 --- a/third_party/packages/flutter_svg/example/android/build.gradle +++ b/third_party/packages/flutter_svg/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() jcenter()