diff --git a/CHANGELOG.md b/CHANGELOG.md index 59763e6c..bac053da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 9.3.0 + +* [**CHORE**] Migrate to built-in Kotlin. AGP 9.0 will remove support for plugins that apply the Kotlin Gradle Plugin. Removes `apply plugin: "kotlin-android"` and the KGP classpath from `android/build.gradle`, and the same from `example/android/app/build.gradle`. Bumps minimum Flutter version to 3.44.0 and Dart SDK to 3.12.0 as required by the new `kotlin.compilerOptions` DSL. + ## 9.2.2 * [**FIX**] Resolved frequent ForegroundServiceDidNotStartInTime and ForegroundServiceDidNotStopInTime exceptions by avoiding redundant foreground service start contracts. [#377](https://github.com/Dev-hwang/flutter_foreground_task/pull/377) diff --git a/android/build.gradle b/android/build.gradle index ccc66918..6d692ec2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,7 +2,6 @@ group 'com.pravera.flutter_foreground_task' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.9.10' repositories { google() mavenCentral() @@ -10,7 +9,6 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:8.6.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -22,7 +20,6 @@ rootProject.allprojects { } apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' android { // Conditional for compatibility with AGP <4.2. @@ -37,10 +34,6 @@ android { targetCompatibility JavaVersion.VERSION_11 } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11 - } - sourceSets { main.java.srcDirs += 'src/main/kotlin' test.java.srcDirs += 'src/test/kotlin' @@ -71,3 +64,9 @@ android { } } } + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 + } +} diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 2d41fcda..e701b5e7 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,6 +1,5 @@ plugins { id "com.android.application" - id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" } @@ -33,10 +32,6 @@ android { targetCompatibility JavaVersion.VERSION_11 } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11 - } - sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -72,3 +67,9 @@ flutter { } dependencies {} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 + } +} diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 1967e2d9..9e5fb82e 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -2,3 +2,5 @@ org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true android.enableR8=true +android.builtInKotlin=true +android.newDsl=true diff --git a/pubspec.yaml b/pubspec.yaml index 14ad72b2..1445029a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: flutter_foreground_task description: This plugin is used to implement a foreground service on the Android platform. -version: 9.2.2 +version: 9.3.0 homepage: https://github.com/Dev-hwang/flutter_foreground_task environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: flutter: