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

connectAnimatedNodes crash on Android 12 #4242

Closed
mmmoussa opened this issue Mar 17, 2023 · 11 comments
Closed

connectAnimatedNodes crash on Android 12 #4242

mmmoussa opened this issue Mar 17, 2023 · 11 comments
Labels
Missing repro This issue need minimum repro scenario Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android

Comments

@mmmoussa
Copy link

Description

Seeing the following stack trace from a production app:

com.facebook.react.bridge.JSApplicationIllegalArgumentException: connectAnimatedNodes: Animated node with tag (child) [1503] does not exist
    at com.facebook.react.animated.NativeAnimatedNodesManager.connectAnimatedNodes(NativeAnimatedNodesManager.java:367)
    at com.facebook.react.animated.NativeAnimatedModule$16.execute(NativeAnimatedModule.java:778)
    at com.facebook.react.animated.NativeAnimatedModule$ConcurrentOperationQueue.executeBatch(NativeAnimatedModule.java:173)
    at com.facebook.react.animated.NativeAnimatedModule$3.execute(NativeAnimatedModule.java:359)
    at com.facebook.react.uimanager.UIViewOperationQueue$UIBlockOperation.execute(UIViewOperationQueue.java:579)
    at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:915)
    at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1026)
    at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:47)
    at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1086)
    at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
    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:1036)
    at android.view.Choreographer.doCallbacks(Choreographer.java:846)
    at android.view.Choreographer.doFrame(Choreographer.java:776)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1023)
    at android.os.Handler.handleCallback(Handler.java:938)
    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:7996)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

All of the crashes are coming from devices running Android 12 and are brands such as Vivo, Infinix, and Realme. I have not been able to reproduce it myself.

Steps to reproduce

Not sure how to repro, but seems to be an issue with specific brands (eg. Vivo, Infinix, and Realme) on Android 12. The issue exists on both reanimated 2 and reanimated 3.

Snack or a link to a repository

N/A (private app and not sure how to repro)

Reanimated version

2.14.4 and 3.0.2

React Native version

0.71.4

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

No response

Acknowledgements

Yes

@mmmoussa mmmoussa added the Needs review Issue is ready to be reviewed by a maintainer label Mar 17, 2023
@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro This issue need minimum repro scenario labels Mar 17, 2023
@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@shubhamguptadream11
Copy link

shubhamguptadream11 commented Mar 20, 2023

Hey @mmmoussa. We are also getting crash with same logs. We reduced this by applying patch in react native library file by disabling useNativeDriver: true to false. We applied patch on @react-navigation/stack lib which we are using for navigating between screens. We had also replaced instance of TouchableOpacity [internally it do useNativeDriver: true] with Pressable. By doing this we are able to reduce its instances by more than 50%.
Hope this helps🙂
We aren't able to repo this yet.

@piaskowyk
Copy link
Member

piaskowyk commented May 15, 2023

Hey! Your issue comes from React Native Animated (com.facebook.react.animated), no from Reanimated. You can try to avoid this issue by using Reanimated, but that means you need to rewrite your animation from Animated to Reanimated API.

@NimeshMadhushka
Copy link

Hey! Your issue comes from React Native Animated (com.facebook.react.animated). You can try to avoid this issue by using Reanimated, but that means you need to rewrite your animation from Animated to Reanimated API.

Wow. Nice solution. So need to redo the 5-6 month project work... I am getting the same error. project is old about one year.

@Saad-Bashar
Copy link

Hey @mmmoussa. We are also getting crash with same logs. We reduced this by applying patch in react native library file by disabling useNativeDriver: true to false. We applied patch on @react-navigation/stack lib which we are using for navigating between screens. We had also replaced instance of TouchableOpacity [internally it do useNativeDriver: true] with Pressable. By doing this we are able to reduce its instances by more than 50%. Hope this helps🙂 We aren't able to repo this yet.

We are also having kind of the same setup. We are using @react-navigation/stack and the version is 5. We have not updated to version 6 yet. Do you think migrating to native-stack instead of stack will solve this?

@alexTamilouski
Copy link

Hey @mmmoussa. We are also getting crash with same logs. We reduced this by applying patch in react native library file by disabling useNativeDriver: true to false. We applied patch on @react-navigation/stack lib which we are using for navigating between screens. We had also replaced instance of TouchableOpacity [internally it do useNativeDriver: true] with Pressable. By doing this we are able to reduce its instances by more than 50%. Hope this helps🙂 We aren't able to repo this yet.

We are also having kind of the same setup. We are using @react-navigation/stack and the version is 5. We have not updated to version 6 yet. Do you think migrating to native-stack instead of stack will solve this?

No, We are using react-navigation v6 and come across the same crash.

@imamrobani
Copy link

still happen, mostly android 12
why this close, has someone fixed it?

@androidIsForVivek
Copy link

Please help anybody to fix this issue.

@piaskowyk
Copy link
Member

This issue comes from react native core not from this library

@cristiano-linvix
Copy link

This issue comes from react native core not from this library

Do you know exactly where?

@raajnadar
Copy link

RN Animated should be deprecated so devs don't use buggy API, RN should add this to their official docs of Animated API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

10 participants