Task :react-native-gesture-handler:compileDebugKotlin FAILED
Description
Hi, after updating react-native-gesture-handler from version "1.10.3" to "2.4.2", I'm having the following error:
Task :react-native-gesture-handler:compileDebugKotlin FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings 208 actionable tasks: 17 executed, 191 up-to-date e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (11, 22): Unresolved reference: common e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (17, 47): Unresolved reference: GestureHandlerStateManager e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (400, 3): 'setGestureHandlerState' overrides nothing
Platforms
- [ ] iOS
- [X] Android
- [ ] Web
Package versions
- React: 16.13.1
- React Native: 0.63.3
- React Native Gesture Handler: 2.4.2
- React Native Reanimated: 2.8.0
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?
Hey! 👋
It looks like you've omitted a few important sections from the issue template.
Please complete Steps To Reproduce and Snack or minimal code example sections.
Hi! This is weird, since it looks like Gesture Handler correctly detects there is Reanimated installed, but it doesn't include it as a dependency. You can try removing the node_modules directory and installing the dependencies again, and clearing the Android project (./gradlew clean or Build -> Clean Project in Android Studio).
Hi! This is weird, since it looks like Gesture Handler correctly detects there is Reanimated installed, but it doesn't include it as a dependency. You can try removing the
node_modulesdirectory and installing the dependencies again, and clearing the Android project (./gradlew cleanor Build -> Clean Project in Android Studio).
Done. Now I have this error:
`e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt: (5, 22): Unresolved reference: reanimated e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt: (8, 35): Unresolved reference: ReanimatedModule e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt: (12, 56): Not enough information to infer type variable T e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/reanimated/src/main/java/com/swmansion/gesturehandler/ReanimatedEventDispatcher.kt: (12, 72): Unresolved reference: ReanimatedModule e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (14, 22): Unresolved reference: common e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (25, 47): Unresolved reference: GestureHandlerStateManager e: /Users/user_name/Projects/project_name/frontend/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt: (410, 3): 'setGestureHandlerState' overrides nothing
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':react-native-gesture-handler:compileDebugKotlin'.`
Looking at the code in ReanimatedEventDispatcher.kt and the dependencies, it looks like I do miss ReanimatedModule:
`package com.swmansion.gesturehandler
import com.facebook.react.bridge.ReactContext import com.facebook.react.uimanager.events.Event import com.swmansion.reanimated.ReanimatedModule
object ReanimatedEventDispatcher { private var reanimatedModule: ReanimatedModule? = null
fun <T : Event<T>>sendEvent(event: T, reactApplicationContext: ReactContext) {
if (reanimatedModule == null) {
reanimatedModule = reactApplicationContext.getNativeModule(ReanimatedModule::class.java)
}
reanimatedModule?.nodesManager?.onEventDispatch(event)
}
} `

Any solution?
Any solution?
I'm using react-native-bottom-sheet (https://github.com/gorhom/react-native-bottom-sheet). I had to downgrade react-native-gesture-handler to 1.10.3. Now it works.
It's hard to tell what's wrong exactly from the error message. A repository, or a list of steps to follow that would allow to reliably reproduce the issue would be greatly appreciated.
+1 i was on 1.10.3, after upgrading, i've encounter this issue.
can someone please close this issue as completed? i was facing the error until i updated to 2.5.0 of react-native-gesutre-handler, and i confirm this issue is solved in that version.
Great, thank for the information!
Any solution?
I'm using react-native-bottom-sheet (https://github.com/gorhom/react-native-bottom-sheet). I had to downgrade react-native-gesture-handler to 1.10.3. Now it works.
Its work for me, thanks