diff --git a/packages/native-date/android/build.gradle b/packages/native-date/android/build.gradle index a37c2e7..b0b9a17 100644 --- a/packages/native-date/android/build.gradle +++ b/packages/native-date/android/build.gradle @@ -21,7 +21,14 @@ def reactNativeArchitectures() { } apply plugin: "com.android.library" -apply plugin: "kotlin-android" +// AGP 9 ships built-in Kotlin support and registers the `kotlin` extension +// itself. Applying the Kotlin plugin on top of it fails configuration with +// "Cannot add extension with name 'kotlin'". Only apply it when nothing has +// registered that extension yet. +if (project.extensions.findByName('kotlin') == null) { + apply plugin: "kotlin-android" +} + apply from: '../nitrogen/generated/android/rnpackages_nativedate+autolinking.gradle' apply plugin: "com.facebook.react"