Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
varungupta85 opened this issue Dec 13, 2023 · 1 comment

Comments

@varungupta85
Copy link

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.

@alainib
Copy link

alainib commented May 6, 2024

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

how do you fixed it please ?

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

No branches or pull requests

2 participants