[Android] Remove explicit versions setting in build.gradle#4146
Open
m-bert wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
buildscriptclasspath dependencies (AGP, Kotlin Gradle plugin, Spotless) so they’re only added whenreact-native-screensis 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This reverts commit 078e9a2.
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
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
ifstatement that adds pinned versions to classpath only if Screens is the root project (e.g. when runningspotless). Both,gradleandkotlin-gradle-pluginare 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
FabricExampleand standalone app with Screens added from generated package build correctly.Checklist