react-native-gesture-handler: [Bug]: RNGestureHandlerModule.attachGestureHandler got 2 arguments, expected 3

Description

After upgrading to v^2 from v1, release apk crashes with error

com.facebook.react.bridge.NativeArgumentsParseException: RNGestureHandlerModule.attachGestureHandler got 2 arguments, expected 3
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:30)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:13)
    at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1)
    at android.os.Looper.loop(Looper.java:214)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:8)
    at java.lang.Thread.run(Thread.java:919)

Screenshots

Steps To Reproduce

  1. Upgrade rngh from v^1 to v2.1.0

Package versions

  • React: 17.0.2
  • React Native: 66.4
  • React Native Gesture Handler: 2.1.0

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 23
  • Comments: 32 (6 by maintainers)

Most upvoted comments

I solved this problem. I try ‘expo install react-native-gesture-handler react-native-reanimated’ , and wrapped root view with GestureHandlerRootView

Same issue here when upgrading react-native-gesture-handler and expo with $ expo upgrade

react-native-gesture-handler 2.1.0 expo 44.0.0 react native 0.64.3 react 17.0.1

Also wrapped my app in a <GestureHandlerRootView> component per gesture-handler installation instructions

Weirdly, this is happening to me only on release builds on android with expo 45 and rn 68.2. I’ve reset the cache, deleted node_modules, reinstalled using expo install react-native-gesture-handler, and looked through my yarn.lock for old version dependencies to no avail.

Its my custom component.

Same here.

   com.facebook.react.bridge.NativeArgumentsParseException: RNGestureHandlerModule.attachGestureHandler got 2 arguments, expected 3
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:349)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
       at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
       at android.os.Looper.loop(Looper.java:236)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
       at java.lang.Thread.run(Thread.java:923)
2022-01-25 15:17:08.506 32713-32713/com.create.wefiq E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
   java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by Timing
       at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:66)
       at com.facebook.react.modules.core.TimingModule.access$000(TimingModule.java:22)
       at com.facebook.react.modules.core.TimingModule$BridgeTimerExecutor.callTimers(TimingModule.java:28)
       at com.facebook.react.modules.core.JavaTimerManager$TimerFrameCallback.doFrame(JavaTimerManager.java:84)
       at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
       at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
       at android.view.Choreographer.doCallbacks(Choreographer.java:880)
       at android.view.Choreographer.doFrame(Choreographer.java:809)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:236)
       at android.app.ActivityThread.main(ActivityThread.java:7861)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)```