From cd1c367b7846c8eb95a8253927be2a48eeb445ad Mon Sep 17 00:00:00 2001 From: saimskywalker <15120878+saimskywalker@users.noreply.github.com> Date: Mon, 26 Oct 2026 23:53:15 +0800 Subject: [PATCH] fix(android): stop the false "applies KGP" warning on built-in Kotlin --- .changes/android-kgp-warning-builtin-kotlin | 1 + android/build.gradle | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .changes/android-kgp-warning-builtin-kotlin diff --git a/.changes/android-kgp-warning-builtin-kotlin b/.changes/android-kgp-warning-builtin-kotlin new file mode 100644 index 000000000..260d04a48 --- /dev/null +++ b/.changes/android-kgp-warning-builtin-kotlin @@ -0,0 +1 @@ +patch type="fixed" "Apply kotlin-android through pluginManager on Android so Flutter no longer warns that livekit_client applies the Kotlin Gradle Plugin when built-in Kotlin is active" diff --git a/android/build.gradle b/android/build.gradle index 97ee768b7..e1debd11f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -32,8 +32,11 @@ def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize(".")[0 def builtInKotlinActive = agpMajor >= 9 && (!project.hasProperty("android.builtInKotlin") || Boolean.parseBoolean(project.property("android.builtInKotlin").toString())) +// pluginManager.apply, not `apply plugin:`: Flutter's KGP detection greps the +// build file for a literal `apply plugin: "kotlin-android"` line and would +// report it even when this guard skips it. if (!builtInKotlinActive) { - apply plugin: "kotlin-android" + pluginManager.apply("kotlin-android") } android {