Skip to content

Commit 034d678

Browse files
fix(android): skip explicit Kotlin plugin when AGP registers the kotlin extension
Co-authored-by: Gabriel Donadel Dall'Agnol <donadeldev@gmail.com>
1 parent 1601100 commit 034d678

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎.changeset/agp9-built-in-kotlin.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/expo-google-signin': patch
3+
'@clerk/expo-passkeys': patch
4+
---
5+
6+
Fix Android builds failing on Android Gradle Plugin 9 with `Cannot add extension with name 'kotlin'`.

‎packages/expo-google-signin/android/build.gradle‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'kotlin-android'
2+
// AGP 9+ registers the `kotlin` extension itself, and applying kotlin-android on top of that fails configuration.
3+
if (project.extensions.findByName('kotlin') == null) {
4+
apply plugin: 'kotlin-android'
5+
}
6+
37
apply plugin: 'maven-publish'
48

59
group = 'expo.modules.clerk.googlesignin'

‎packages/expo-passkeys/android/build.gradle‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'kotlin-android'
2+
// AGP 9+ registers the `kotlin` extension itself, and applying kotlin-android on top of that fails configuration.
3+
if (project.extensions.findByName('kotlin') == null) {
4+
apply plugin: 'kotlin-android'
5+
}
6+
37
apply plugin: 'maven-publish'
48

59
group = 'expo.modules.clerkexpopasskeys'

0 commit comments

Comments
 (0)