Skip to content

[Android] Remove explicit versions setting in build.gradle#4146

Open
m-bert wants to merge 3 commits into
mainfrom
@mbert/dont-pin-kotlin
Open

[Android] Remove explicit versions setting in build.gradle#4146
m-bert wants to merge 3 commits into
mainfrom
@mbert/dont-pin-kotlin

Conversation

@m-bert

@m-bert m-bert commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

This PR is a follow up for the PR from Gesture Handler side. In this issue in our repository it was stated that there are warnings during build phase, namely both, Screens and Gesture Handler try to load their pinned versions of Kotlin.

Changes

To address aforementioned issue, I've added simple if statement that adds pinned versions to classpath only if Screens is the root project (e.g. when running spotless). Both, gradle and kotlin-gradle-plugin are shipped with React Native apps (see template) so it is not necessary to declare them. This could break before RN 0.70, but I don't think that it is relevant at this point.

Test plan

Tested that FabricExample and standalone app with Screens added from generated package build correctly.

Checklist

  • Included code example that can be used to test this change.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

Copilot AI review requested due to automatic review settings June 10, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Android Gradle setup for react-native-screens to avoid pinning/buildscript classpath duplication when the library is consumed as a dependency, addressing build warnings about multiple Kotlin plugin versions being loaded.

Changes:

  • Wrapes buildscript classpath dependencies (AGP, Kotlin Gradle plugin, Spotless) so they’re only added when react-native-screens is the root Gradle project.
  • Leaves consumer apps to rely on their own (React Native-provided) Gradle/Kotlin plugin classpath versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread android/build.gradle
m-bert and others added 2 commits June 10, 2026 13:08
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@m-bert m-bert requested a review from kkafar June 10, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants