software-mansion / react-native-reanimated

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

IllegalStateException java.lang.NullPointerException: Attempt to invoke interface method 'boolean com.swmansion.reanimated.layoutReanimation.NativeMethodsHolder.hasAnimation(int, int)' on a null object reference #5713

Open JClackett opened 5 months ago

JClackett commented 5 months ago

Description

java.lang.NullPointerException: Attempt to invoke interface method 'boolean com.swmansion.reanimated.layoutReanimation.NativeMethodsHolder.hasAnimation(int, int)' on a null object reference
    at com.swmansion.reanimated.layoutReanimation.AnimationsManager.hasAnimationForTag(AnimationsManager.java:497)
    at com.swmansion.reanimated.layoutReanimation.SharedTransitionManager$SnapshotTreeVisitor.run(SharedTransitionManager.java:493)
    at com.swmansion.reanimated.layoutReanimation.SharedTransitionManager.visitTree(SharedTransitionManager.java:529)
    at com.swmansion.reanimated.layoutReanimation.SharedTransitionManager.visitTreeForTags(SharedTransitionManager.java:515)
    at com.swmansion.reanimated.layoutReanimation.SharedTransitionManager.onViewsRemoval(SharedTransitionManager.java:72)
    at com.swmansion.reanimated.layoutReanimation.AnimationsManager.notifyAboutViewsRemoval(AnimationsManager.java:724)
    at com.swmansion.reanimated.layoutReanimation.ReanimatedNativeHierarchyManager.manageChildren(ReanimatedNativeHierarchyManager.java:381)
    at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:217)
    at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:926)
    at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1037)
    at com.facebook.react.uimanager.UIViewOperationQueue.-$$Nest$mflushPendingBatches
    at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:995)
    at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:29)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8762)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Steps to reproduce

Finding it very hard to reproduce, seems to happen randomly and sporadically - will keep trying to reproduce, but posting in here in case others have run into and or team knows based on stack trace what the issue could be.

Snack or a link to a repository

https://trying-to-get.one

Reanimated version

3.6.2

React Native version

0.73.4

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

Real device

Device model

Samsung A32

Acknowledgements

Yes

github-actions[bot] commented 5 months 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?

GSTJ commented 4 months ago

Having the same issue here, affecting a lot of android devices.

Latropos commented 4 months ago

@GSTJ @JClackett Is there any chance of getting a reproduction? Do you use SharedElementTransition? How do you use them?

vlimag commented 3 months ago

getting the same here:

Not sure how to reproduce as this one is affecting android devices in prod. Running in some physical and emulator devices but cant reproduce.

Affecting a lot of users:

GSTJ commented 2 months ago

Can confirm it happens on the latest version of reanimated still.

GSTJ commented 2 months ago

No SharedElementTransition (not that we asked or coded), nothing out of the ordinary. I can't reproduce myself, it's all from Sentry logs.

Seems to usually happen right after a code push update.

Captura de Tela 2024-04-26 às 12 04 19
robertmunceanu commented 1 month ago

Having the same issue for various Android devices.