react-native-draggable-flatlist icon indicating copy to clipboard operation
react-native-draggable-flatlist copied to clipboard

com.facebook.jni.CppException: Cannot read property '__workletHash' of undefined

Open varungupta85 opened this issue 2 years ago • 1 comments

This package has external dependencies of react-native-reanimated and react-native-gesture-handler which must be installed separately. Before opening an issue related to animations or gestures please verify that you have completed ALL installation steps, including the changes to MainActivity.

Describe the bug I get the following errors when I try to use this library in production app. The app works fine in debug mode.

iOS

libc++abi: terminating due to uncaught exception of type facebook::jsi::JSError: undefined is not an object (evaluating 'fun.__workletHash')

runOnJS@
runOnJS@[native code]
setupConsole@
setupConsole@[native code]
anonymous@
anonymous@[native code]
anonymous@
anonymous@[native code]
(lldb) 

Android

FATAL EXCEPTION: main
  Process: com.myapp, PID: 4977
  com.facebook.jni.CppException: Cannot read property '__workletHash' of undefined
  
  TypeError: Cannot read property '__workletHash' of undefined
      at runOnJS (JavaScript:1:276)
      at setupConsole (JavaScript:1:187)
      at anonymous (JavaScript:1:163)
      at apply (native)
      at anonymous (JavaScript:1:65)
  	at com.swmansion.reanimated.AndroidUIScheduler.triggerUI(Native Method)
  	at com.swmansion.reanimated.AndroidUIScheduler$1.run(AndroidUIScheduler.java:24)
  	at com.swmansion.reanimated.AndroidUIScheduler$2.runGuarded(AndroidUIScheduler.java:43)
  	at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:30)
  	at android.os.Handler.handleCallback(Handler.java:942)
  	at android.os.Handler.dispatchMessage(Handler.java:99)
  	at android.os.Looper.loopOnce(Looper.java:201)
  	at android.os.Looper.loop(Looper.java:288)
  	at android.app.ActivityThread.main(ActivityThread.java:7872)
  	at java.lang.reflect.Method.invoke(Native Method)
  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Even though the problem is rooted in the react-native-reanimated package, it only surfaces when I use this package to make a list draggable and that too only in release mode. I suspect it has something to do with some plugin configuration/setup but don't know how to find the problem.

Please help if you know what could be wrong.

To Reproduce I am unable to provide a snack for this issue.

Platform & Dependencies Please list any applicable dependencies in addition to those below (react-navigation etc).

  • react-native-draggable-flatlist version: 4.0.1
  • Platform: iOS and Android
  • React Native or Expo version: 0.72.5
  • Reanimated version: 3.6.1
  • React Native Gesture Handler version: 2.14.0

Additional context I am using it in monorepo setup using Yarn Workspaces.

varungupta85 avatar Dec 13 '23 03:12 varungupta85

i have same error but only in release mode not dev mode

how do you fixed it please ?

alainib avatar May 06 '24 08:05 alainib