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
5 changes: 5 additions & 0 deletions .changeset/agp9-built-in-kotlin.md
Original file line number Diff line number Diff line change
@@ -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
9 changes: 8 additions & 1 deletion packages/react-native-bottom-tabs/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Loading