Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.3.1

- [Android] Fix "Could not find method kotlin()" build failure on AGP 9 when built-in Kotlin is disabled (the Flutter template default) — only configure the kotlin {} DSL when the Kotlin Gradle Plugin is applied, and apply KGP when built-in Kotlin is off (#86)

## 6.3.0

- [iOS] Raised declared deployment target to 13.0 to match the minimum already required by Flutter 3.44+
Expand Down
20 changes: 15 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ rootProject.allprojects {

apply plugin: 'com.android.library'

// AGP 9+ has built-in Kotlin support; older versions need the plugin explicitly.
// AGP 9+ has built-in Kotlin support, but only when the consumer enables it
// (android.builtInKotlin=true). Apply the Kotlin Gradle Plugin on older AGP, or
// whenever built-in Kotlin is off, so the kotlin {} DSL always has a provider.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
if (agpMajor < 9) {
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()
if (agpMajor < 9 || !builtInKotlin) {
apply plugin: 'kotlin-android'
}

Expand Down Expand Up @@ -54,9 +60,13 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
// The kotlin {} DSL is only registered when the Kotlin Gradle Plugin is applied;
// under built-in Kotlin (no KGP) it is absent, so guard the configuration.
plugins.withId("org.jetbrains.kotlin.android") {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_archive
description: Create and extract ZIP archive files in Android, iOS and macOS. Zip all files in a directory recursively or a given list of files.
version: 6.3.0
version: 6.3.1
homepage: https://github.com/kineapps/flutter_archive
repository: https://github.com/kineapps/flutter_archive

Expand Down
Loading