From 077dda8d5fe2f5a4738bbad833446dacda8b19e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 9 Jun 2026 15:24:00 +0200 Subject: [PATCH 1/6] Do not pin kotlin version --- .../react-native-gesture-handler/android/build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-native-gesture-handler/android/build.gradle b/packages/react-native-gesture-handler/android/build.gradle index e6bcad6d9a..b2d9e08fcf 100644 --- a/packages/react-native-gesture-handler/android/build.gradle +++ b/packages/react-native-gesture-handler/android/build.gradle @@ -10,7 +10,14 @@ buildscript { } dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") + def rootProvidesKotlinPlugin = rootProject != project && + rootProject.buildscript.configurations.classpath.dependencies.any { + it.group == 'org.jetbrains.kotlin' && it.name == 'kotlin-gradle-plugin' + } + + if (!rootProvidesKotlinPlugin) { + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") + } classpath("com.android.tools.build:gradle:8.10.1") classpath("com.diffplug.spotless:spotless-plugin-gradle:7.0.4") } From ed5a428de24eb9f64286a6de83daafac34f70405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 9 Jun 2026 15:32:02 +0200 Subject: [PATCH 2/6] Update docs --- .../docs/fundamentals/installation.mdx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/docs-gesture-handler/docs/fundamentals/installation.mdx b/packages/docs-gesture-handler/docs/fundamentals/installation.mdx index 0c9881ac75..ad935ee4b0 100644 --- a/packages/docs-gesture-handler/docs/fundamentals/installation.mdx +++ b/packages/docs-gesture-handler/docs/fundamentals/installation.mdx @@ -91,16 +91,6 @@ export function CustomModal({ children, ...rest }) { } ``` -Gesture Handler on Android is implemented in Kotlin. If you need to set a specific Kotlin version to be used by the library, set the `kotlinVersion` ext property in the `android/build.gradle` file and RNGH will use that version: - -```groovy -buildscript { - ext { - kotlinVersion = "2.1.20" - } -} -``` - #### iOS While developing for iOS, make sure to install [pods](https://cocoapods.org/) first before running the app: From 57196ae14ed7af885a334e1c9f16c667ef6b447d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bert?= <63123542+m-bert@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:36:26 +0200 Subject: [PATCH 3/6] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- packages/react-native-gesture-handler/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-gesture-handler/android/build.gradle b/packages/react-native-gesture-handler/android/build.gradle index b2d9e08fcf..579ff25cc3 100644 --- a/packages/react-native-gesture-handler/android/build.gradle +++ b/packages/react-native-gesture-handler/android/build.gradle @@ -14,7 +14,7 @@ buildscript { rootProject.buildscript.configurations.classpath.dependencies.any { it.group == 'org.jetbrains.kotlin' && it.name == 'kotlin-gradle-plugin' } - + if (!rootProvidesKotlinPlugin) { classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } From e8c497d483701d4606f6646423ecea44e4d49bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Wed, 10 Jun 2026 10:55:40 +0200 Subject: [PATCH 4/6] Remove pinning version entirely --- .../react-native-gesture-handler/android/build.gradle | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/react-native-gesture-handler/android/build.gradle b/packages/react-native-gesture-handler/android/build.gradle index 579ff25cc3..3cc4fae23e 100644 --- a/packages/react-native-gesture-handler/android/build.gradle +++ b/packages/react-native-gesture-handler/android/build.gradle @@ -2,22 +2,12 @@ import groovy.json.JsonSlurper import com.android.build.gradle.tasks.ExternalNativeBuildJsonTask buildscript { - def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['RNGH_kotlinVersion'] - repositories { mavenCentral() google() } dependencies { - def rootProvidesKotlinPlugin = rootProject != project && - rootProject.buildscript.configurations.classpath.dependencies.any { - it.group == 'org.jetbrains.kotlin' && it.name == 'kotlin-gradle-plugin' - } - - if (!rootProvidesKotlinPlugin) { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") - } classpath("com.android.tools.build:gradle:8.10.1") classpath("com.diffplug.spotless:spotless-plugin-gradle:7.0.4") } From 1d3bd0fc587f800f9e2a6caf58aa0154504bc061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Wed, 10 Jun 2026 11:01:27 +0200 Subject: [PATCH 5/6] Remove pinned gradle version --- packages/react-native-gesture-handler/android/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native-gesture-handler/android/build.gradle b/packages/react-native-gesture-handler/android/build.gradle index 3cc4fae23e..f01e419d3d 100644 --- a/packages/react-native-gesture-handler/android/build.gradle +++ b/packages/react-native-gesture-handler/android/build.gradle @@ -8,7 +8,6 @@ buildscript { } dependencies { - classpath("com.android.tools.build:gradle:8.10.1") classpath("com.diffplug.spotless:spotless-plugin-gradle:7.0.4") } } From 671757c77107a4e17b09eeb64308c99112b11c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Wed, 10 Jun 2026 11:23:58 +0200 Subject: [PATCH 6/6] Use if --- packages/react-native-gesture-handler/android/build.gradle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native-gesture-handler/android/build.gradle b/packages/react-native-gesture-handler/android/build.gradle index f01e419d3d..3f5f514cc1 100644 --- a/packages/react-native-gesture-handler/android/build.gradle +++ b/packages/react-native-gesture-handler/android/build.gradle @@ -8,7 +8,12 @@ buildscript { } dependencies { - classpath("com.diffplug.spotless:spotless-plugin-gradle:7.0.4") + if (project == rootProject) { + def kotlin_version = project.properties['RNGH_kotlinVersion'] + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") + classpath("com.android.tools.build:gradle:8.10.1") + classpath("com.diffplug.spotless:spotless-plugin-gradle:7.0.4") + } } }