From dc99ae2e6564b8bb748885568ecefb0f7dd3e535 Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Fri, 27 Sep 2024 08:06:59 -0400 Subject: [PATCH 1/2] Update java to 17 --- .github/workflows/release.yml | 2 +- android/app/build.gradle | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae18d24..1f2d192 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-java@v2 with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Install flutter uses: subosito/flutter-action@v2 diff --git a/android/app/build.gradle b/android/app/build.gradle index ed72850..9cf20bb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -29,12 +29,12 @@ android { compileSdkVersion 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 + jvmTarget = JavaVersion.VERSION_17 } sourceSets { From 70b344bbbdad18d30aa9d597233eae3da557c4bb Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Fri, 27 Sep 2024 08:43:26 -0400 Subject: [PATCH 2/2] Use java toolchain instead of explicit targets --- android/app/build.gradle | 15 ++++++--------- android/settings.gradle | 1 + 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9cf20bb..1f8ad57 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -28,15 +28,6 @@ android { compileSdkVersion 34 - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17 - } - sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -72,6 +63,12 @@ android { } } +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + flutter { source '../..' } diff --git a/android/settings.gradle b/android/settings.gradle index 3192560..3ff10ee 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -17,6 +17,7 @@ pluginManagement { } plugins { + id "org.gradle.toolchains.foojay-resolver-convention" version "0.8.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version '8.6.1' apply false id "org.jetbrains.kotlin.android" version "2.0.20" apply false