From ddd726abb259e0797f30212c354f600e94eafc68 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Dall'Agnol Date: Fri, 4 Sep 2026 08:27:52 -0700 Subject: [PATCH 1/2] fix(android): skip explicit Kotlin plugin when AGP registers the kotlin extension AGP 9 ships built-in Kotlin support and registers the kotlin extension itself. Applying the Kotlin plugin again fails configuration with "Cannot add extension with name 'kotlin'". Check for the extension directly, which needs no AGP version table and covers AGP 10, where the android.builtInKotlin opt-out is removed. --- packages/react-native-bottom-tabs/android/build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-native-bottom-tabs/android/build.gradle b/packages/react-native-bottom-tabs/android/build.gradle index f0892bd0..77350168 100644 --- a/packages/react-native-bottom-tabs/android/build.gradle +++ b/packages/react-native-bottom-tabs/android/build.gradle @@ -19,7 +19,14 @@ def isNewArchitectureEnabled() { } 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 plugin: "kotlin-kapt" if (isNewArchitectureEnabled()) { From 3130475f29b6f90d5da21d7b9cce52d21db897fe Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Sun, 6 Sep 2026 13:22:48 +0100 Subject: [PATCH 2/2] chore: add changeset Co-Authored-By: Claude Fable 5.1 --- .changeset/agp9-built-in-kotlin.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/agp9-built-in-kotlin.md diff --git a/.changeset/agp9-built-in-kotlin.md b/.changeset/agp9-built-in-kotlin.md new file mode 100644 index 00000000..61c9221c --- /dev/null +++ b/.changeset/agp9-built-in-kotlin.md @@ -0,0 +1,5 @@ +--- +'react-native-bottom-tabs': patch +--- + +Fix Android build with AGP 9 built-in Kotlin: skip applying the `kotlin-android` plugin when AGP has already registered the `kotlin` extension