Skip to content

Commit 94bf4fc

Browse files
author
Rick van Dijk
committed
kotlin migration
1 parent a12467f commit 94bf4fc

8 files changed

Lines changed: 19 additions & 14 deletions

File tree

flutter_cache_manager/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## [Unreleased]
22

33
* Modernizes GitHub Actions CI (combined quality job, pinned Flutter 3.44.4, Dependabot for actions)
4-
* Updates example Android project to AGP 8.11.1 / Gradle 8.14 / Kotlin 2.2.20 for compatibility with current Flutter tooling and `jni`
4+
* Updates example Android project to AGP 9.0.1 / Gradle 9.1 / Kotlin 2.3.20
5+
* Migrates example Android app to built-in Kotlin
6+
* Pins example `path_provider_android` to 2.2.22 to avoid transitive `jni` / `jni_flutter` AGP 9 issues
57

68
## [3.4.2]
79

flutter_cache_manager/example/android/app/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id "com.android.application"
3-
id "kotlin-android"
4-
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
3+
// The Flutter Gradle Plugin must be applied after the Android Gradle plugin.
54
id "dev.flutter.flutter-gradle-plugin"
65
}
76

@@ -15,10 +14,6 @@ android {
1514
targetCompatibility = JavaVersion.VERSION_17
1615
}
1716

18-
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_17
20-
}
21-
2217
defaultConfig {
2318
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2419
applicationId = "com.example.example"
@@ -39,6 +34,12 @@ android {
3934
}
4035
}
4136

37+
kotlin {
38+
compilerOptions {
39+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
40+
}
41+
}
42+
4243
flutter {
4344
source = "../.."
4445
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
4-
# Flutter migrator keeps these for AGP 8 / plugin compatibility
4+
# Flutter migrator defaults while transitive plugins finish AGP 9 / built-in Kotlin migration.
55
android.builtInKotlin=false
66
android.newDsl=false

flutter_cache_manager/example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip

flutter_cache_manager/example/android/settings.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
// Stay on AGP 8.x: AGP 9 + Flutter's builtInKotlin=false opt-out breaks jni 1.0.1
22-
id "com.android.application" version "8.11.1" apply false
23-
id "org.jetbrains.kotlin.android" version "2.2.20" apply false
21+
id "com.android.application" version "9.0.1" apply false
22+
id "org.jetbrains.kotlin.android" version "2.3.20" apply false
2423
}
2524

2625
include ":app"

flutter_cache_manager/example/linux/flutter/generated_plugins.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
77
)
88

99
list(APPEND FLUTTER_FFI_PLUGIN_LIST
10-
jni
1110
)
1211

1312
set(PLUGIN_BUNDLED_LIBRARIES)

flutter_cache_manager/example/pubspec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@ dev_dependencies:
1919
sdk: flutter
2020
flutter_lints: ^6.0.0
2121

22+
# path_provider_android 2.3.x pulls jni/jni_flutter, which still break under AGP 9
23+
# with Flutter's temporary builtInKotlin=false opt-out. Pin until those plugins ship a fix.
24+
dependency_overrides:
25+
path_provider_android: 2.2.22
26+
2227
flutter:
2328
uses-material-design: true

flutter_cache_manager/example/windows/flutter/generated_plugins.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
77
)
88

99
list(APPEND FLUTTER_FFI_PLUGIN_LIST
10-
jni
1110
)
1211

1312
set(PLUGIN_BUNDLED_LIBRARIES)

0 commit comments

Comments
 (0)