App crashes randomly on Android 12 with `JSApplicationIllegalArgumentException: Animated node with tag ### does not exists`
See original GitHub issueDescription
com.facebook.react.bridge.JSApplicationIllegalArgumentException: Animated node with tag 201 does not exists at com.facebook.react.animated.NativeAnimatedNodesManager.connectAnimatedNodes(NativeAnimatedNodesManager.java:317) at com.facebook.react.animated.NativeAnimatedModule$15.execute(NativeAnimatedModule.java:681) at com.facebook.react.animated.NativeAnimatedModule.executeAllOperations(NativeAnimatedModule.java:258) at com.facebook.react.animated.NativeAnimatedModule.access$400(NativeAnimatedModule.java:85) at com.facebook.react.animated.NativeAnimatedModule$3.execute(NativeAnimatedModule.java:287) at com.facebook.react.uimanager.UIViewOperationQueue$UIBlockOperation.execute(UIViewOperationQueue.java:573) at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:908) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1019) at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:47) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1079) 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:1140) at android.view.Choreographer.doCallbacks(Choreographer.java:946) at android.view.Choreographer.doFrame(Choreographer.java:870) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1127) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:210) at android.os.Looper.loop(Looper.java:299) at android.app.ActivityThread.main(ActivityThread.java:8085) at java.lang.reflect.Method.invoke(Method.java:-2) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
Version
0.64.2
Output of npx react-native info
System: OS: macOS 11.4 CPU: (4) x64 Intel® Core™ i5-7360U CPU @ 2.30GHz Memory: 65.65 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.10.0 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 7.24.0 - /usr/local/bin/npm Watchman: 2021.09.13.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: API Levels: 23, 25, 27, 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.2 System Images: android-29 | Intel x86 Atom_64 Android NDK: 22.1.7171670 IDEs: Android Studio: 4.2 AI-202.7660.26.42.7351085 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.2 => 0.64.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
App crashes randomly in Android
Snack, code example, screenshot, or link to a repository
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:35
- Comments:156 (13 by maintainers)
Top GitHub Comments
@coolguy001tv Thanks for the context. You’re correct, that’s a valid bug. After some investigation, we realized that this bug seems to happen ONLY on Android 12 and mostly on Samsung devices.
We still haven’t figured out what is the root cause, but the fix for it should be this: https://github.com/facebook/react-native/commit/b347c3949f40b33df300a31ab7f86df4d82a00b2
Sadly, this commit hasn’t been released yet and won’t be available before React Native 0.69.x. In that version you should be able to execute the extra logic with:
ReactFeatureFlags.enableSynchronizationForAnimated = true
In your Application
onCreate
section.@ShikaSD also has more context on this. We’re actively monitoring this bug, and we’ll come back with more context if we do further discoveries.
I’am getting this error too!
I created a repo with a simple app as example: https://github.com/jefersonvinicius/react-native-crashing-example
Some extra information: