Skip to content

Commit 4af41be

Browse files
authored
Merge pull request #208 from gabrieldonadel/fix/agp9-built-in-kotlin
fix(android): skip explicit Kotlin plugin when AGP registers the kotlin extension
2 parents b9f62ee + 6b4ca30 commit 4af41be

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

android/build.gradle

100755100644
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ if (project == rootProject) {
2323
}
2424

2525
apply plugin: "com.android.library"
26-
apply plugin: "kotlin-android"
26+
// AGP 9 ships built-in Kotlin support and registers the `kotlin` extension
27+
// itself. Applying the Kotlin plugin on top of it fails configuration with
28+
// "Cannot add extension with name 'kotlin'". Only apply it when nothing has
29+
// registered that extension yet.
30+
if (project.extensions.findByName('kotlin') == null) {
31+
apply plugin: "kotlin-android"
32+
}
2733

2834
if (isNewArchitectureEnabled()) {
2935
apply plugin: "com.facebook.react"

0 commit comments

Comments
 (0)