software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.6k stars 1.26k forks source link

com.facebook.react.uimanager.IllegalViewOperationException: Trying to resolve view with tag 2133 which doesn't exist #6091

Closed Vaib215 closed 3 weeks ago

Vaib215 commented 3 weeks ago

Description

I got the following issue in codepush crashes for my app in production

com.facebook.react.uimanager.NativeViewHierarchyManager.resolveView NativeViewHierarchyManager.java, line 102 com.facebook.react.uimanager.IllegalViewOperationException: Trying to resolve view with tag 2133 which doesn't exist

Stack Trace

com.facebook.react.uimanager.NativeViewHierarchyManager.resolveView NativeViewHierarchyManager.java:102
com.swmansion.reanimated.layoutReanimation.SharedTransitionManager.getSharedElementsForCurrentTransition SharedTransitionManager.java:274
com.swmansion.reanimated.layoutReanimation.SharedTransitionManager.prepareSharedTransition SharedTransitionManager.java:185
com.swmansion.reanimated.layoutReanimation.SharedTransitionManager.tryStartSharedTransitionForViews SharedTransitionManager.java:217
com.swmansion.reanimated.layoutReanimation.SharedTransitionManager.access$100 SharedTransitionManager.java:30
com.swmansion.reanimated.layoutReanimation.SharedTransitionManager$TopWillAppearListener.onEventDispatch SharedTransitionManager.java:61
com.facebook.react.uimanager.events.EventDispatcherImpl.dispatchEvent EventDispatcherImpl.java:116
com.swmansion.rnscreens.ScreenFragment.dispatchLifecycleEvent ScreenFragment.kt:209
com.swmansion.rnscreens.ScreenFragment.dispatchOnWillAppear ScreenFragment.kt:175
com.swmansion.rnscreens.ScreenFragment.dispatchViewAnimationEvent$lambda-8 ScreenFragment.kt:289
com.swmansion.rnscreens.ScreenFragment.$r8$lambda$acfFq_XavoVj9P4B8s6sdtwvx2c
com.swmansion.rnscreens.ScreenFragment$$ExternalSyntheticLambda0.run
android.os.Handler.handleCallback Handler.java:873
android.os.Handler.dispatchMessage Handler.java:99
android.os.Looper.loop Looper.java:233
android.app.ActivityThread.main ActivityThread.java:7225
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:499
com.android.internal.os.ZygoteInit.main ZygoteInit.java:962

I dont know how to get a repro as the root cause is not evident.

Steps to reproduce

Unable to reproduce

Snack or a link to a repository

NA

Reanimated version

3.11.0

React Native version

0.72.4

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

Lava Agni 2 5g

Acknowledgements

Yes

github-actions[bot] commented 3 weeks ago

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?

github-actions[bot] commented 3 weeks ago

Hey! πŸ‘‹

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

Vaib215 commented 3 weeks ago

Please dont ask for a repro, I am unable to reproduce it

joe-sam commented 3 weeks ago

This is a longstanding known bug I think and finally has a possible PR fix having discovered the view Tags randomly change while re rendering. Make animated component's event tag properly update #6030 You could try to memoize components to prevent unneeded re renders and see if that mitigates the problem till the fix is released.

szydlovsky commented 3 weeks ago

Thanks for noticing @joe-sam!

joe-sam commented 2 weeks ago

@szydlovsky Thank you for fixing this underlying bug.

5767 has mitigating try-catch blocks but even those are super expensive for performance especially when unnecessarily triggered on so many animation frames.

Is there a nightly version for PR's that can be run to check if these similar issues are solved and where could we find that ?

Vaib215 commented 2 weeks ago

Can we expect a release addressing this issue any time soon?

szydlovsky commented 2 weeks ago

@joe-sam @Vaib215 yes, if you take a look at npm versions of Reanimated, the latest nightly build should have the mentioned fix.

szydlovsky commented 2 weeks ago

In terms of stable release, expect one closer to the end of June