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 {