[Android] Do not set explicit versions in build.gradle #4248
Open
m-bert wants to merge 7 commits into
Open
Conversation
m-bert
commented
Jun 9, 2026
| } | ||
| ``` | ||
|
|
||
| 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: |
Collaborator
Author
There was a problem hiding this comment.
I'm not sure if we want to remove it entirely, or add info that it is not supported anymore (e.g. starting from 3.1.0)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces Android build warnings about the Kotlin Gradle plugin being loaded multiple times by avoiding adding an explicit kotlin-gradle-plugin classpath dependency when the root project already provides it. It also updates the installation docs to remove guidance about forcing a specific Kotlin version for RNGH.
Changes:
- Conditionally adds
org.jetbrains.kotlin:kotlin-gradle-pluginto thebuildscriptclasspath only when the root project does not already include it. - Removes the documentation section describing how to override RNGH’s Kotlin version via
ext.kotlinVersion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/react-native-gesture-handler/android/build.gradle | Adds a root-project classpath check to avoid explicitly loading the Kotlin Gradle plugin when it’s already provided. |
| packages/docs-gesture-handler/docs/fundamentals/installation.mdx | Removes Kotlin-version override instructions from the Android installation docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
build.gradle build.gradle
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Gesture Handler loads specific Kotlin version during build. This is unnecessary and may cause build warnings, such as one described in #2307.
This PR removes pinning of specific kotlin/gradle versions when Gesture Handler is not root project, so we fallback to the ones declared by the root. Unfortunately we can't simply remove those lines, as
spotlesswould fail.Fixes #2307
Test plan
Tested that android build correctly in basic-example, expo-example and standalone app.