Skip to content

fix(android): compile RNGestureHandlerModule with Kotlin 2.3#4043

Merged
m-bert merged 4 commits intosoftware-mansion:v2-stablefrom
christian-apollo:fix/android-kotlin-23-rootview-tag
Apr 2, 2026
Merged

fix(android): compile RNGestureHandlerModule with Kotlin 2.3#4043
m-bert merged 4 commits intosoftware-mansion:v2-stablefrom
christian-apollo:fix/android-kotlin-23-rootview-tag

Conversation

@christian-apollo
Copy link
Copy Markdown

@christian-apollo christian-apollo commented Mar 27, 2026

Summary

Fixes Android compilation when using Kotlin 2.3.x. The previous code compared it.rootView.rootViewTag to a local rootViewTag; the local name shadows the synthetic property accessor, and Kotlin 2.3 reports:

Function invocation getRootViewTag() expected

Use an explicit receiver and ReactRootView#getRootViewTag() instead.

Context

Test plan

  • ./gradlew :packages:react-native-gesture-handler:compileDebugKotlin (or project-equivalent) with Kotlin 2.3.x

actions-user and others added 4 commits December 19, 2025 16:47
…#4039)

## Description

Current logic dedicated to handling `RNRootViewGestureRecognizer` on iOS
looks only for RN's native roots. When gestures are used inside Screens'
`FullWindowOverlay`, the logic doesn't do anything, but the overlay has
its own
[`RCTSurfaceTouchHandler`](https://github.com/software-mansion/react-native-screens/blob/be64b6d9a17c3a4647806f252e075b96b9f690cc/ios/RNSFullWindowOverlay.mm#L158).

This PR updates the traversal logic so it handles
`RNSFullWindowOverlayContainer` the same way as `RCTSurfaceView`.

## Test plan

I wasn't able to reproduce the problem, but in theory, it's possible
that without this change, recognizers from RNGH and
RCTSurfaceTouchHandler could run simultaneously, since this path never
ran:
https://github.com/software-mansion/react-native-gesture-handler/blob/5587435679eabe3f8690f077ba7c2ecc3e354a14/packages/react-native-gesture-handler/apple/RNRootViewGestureRecognizer.m#L55-L63
Avoid shadowing between the local `rootViewTag` and the synthetic Kotlin
property on `ReactRootView` by using an explicit receiver and
`getRootViewTag()`.

Fixes compilation with Kotlin 2.3.x toolchains (e.g. alongside Stripe and
other SDKs built with Kotlin 2.3 metadata).

Made-with: Cursor
Copy link
Copy Markdown
Collaborator

@m-bert m-bert left a comment

Choose a reason for hiding this comment

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

Thank you ❤️

@m-bert m-bert merged commit 7bf8b07 into software-mansion:v2-stable Apr 2, 2026
4 checks passed
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.

4 participants