addListener called on UI thread when Skia Canvas uses Reanimated SharedValues (Expo SDK 55) #3723
Unanswered
miguelartazos
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After upgrading to Expo SDK 55, the app crashes with: Worklets] Tried to synchronously call a non-worklet function 'addListener' on the UI thread
Environment:
Reproduction:
The crash happens when a Skia
Canvasreceives Reanimated SharedValues as props (e.g.height={topHeight},y={bottomY}). It occurs when the component mounts.Hypothesis:
Reanimated's mapper (which runs on the UI thread) appears to call
addListenerwhen Skia subscribes to SharedValue changes.addListeneris a JS-thread API, so calling it from the UI thread triggers the crash.Workaround:
Disabling the component that uses Skia + SharedValues (or replacing it with
View+useAnimatedStyle) avoids the crash.Has anyone else seen this? Any suggestions for using Skia with Reanimated SharedValues on SDK 55?
Environment:- Expo SDK 55- react-native-reanimated 4.2.1- react-native-worklets 0.7.1- @shopify/react-native-skia 2.4.21**Reproduction:**The crash happens when a Skia
Canvasreceives Reanimated SharedValues as props (e.g.height={topHeight},y={bottomY}). It occurs when the component mounts.**Hypothesis:**Reanimated's mapper (which runs on the UI thread) appears to calladdListenerwhen Skia subscribes to SharedValue changes.addListeneris a JS-thread API, so calling it from the UI thread triggers the crash.**Workaround:**Disabling the component that uses Skia + SharedValues (or replacing it withView+useAnimatedStyle) avoids the crash.Has anyone else seen this? Any suggestions for using Skia with Reanimated SharedValues on SDK 55?Beta Was this translation helpful? Give feedback.
All reactions