Skip to content

Commit 7bf8b07

Browse files
christian-apolloactions-userj-piasecki
authored
fix(android): compile RNGestureHandlerModule with Kotlin 2.3 (#4043)
## 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 - Downstream projects bump Kotlin (e.g. to **2.3.0**) for dependencies such as **Stripe Android SDK** and hit a hard failure in `:react-native-gesture-handler:compileDebugKotlin`. - Closes #4042. ## Test plan - [ ] `./gradlew :packages:react-native-gesture-handler:compileDebugKotlin` (or project-equivalent) with Kotlin **2.3.x** --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Jakub Piasecki <jakub.piasecki@swmansion.com>
1 parent 686e015 commit 7bf8b07

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ class RNGestureHandlerModule(reactContext: ReactApplicationContext?) :
170170
}
171171
synchronized(roots) {
172172
return roots.firstOrNull {
173-
it.rootView is ReactRootView && it.rootView.rootViewTag == rootViewTag
173+
val rv = it.rootView
174+
rv is ReactRootView && rv.getRootViewTag() == rootViewTag
174175
}
175176
}
176177
}

0 commit comments

Comments
 (0)