React-native: [Android] Node has not been attached to a view in `PropsAnimatedNode.updateView`

Created on 13 Mar 2017  路  17Comments  路  Source: facebook/react-native

Description

Seems like there are some rare cases will cause the following error:

Fatal Exception: java.lang.IllegalStateException: Node has not been attached to a view
       at com.facebook.react.animated.PropsAnimatedNode.updateView(PropsAnimatedNode.java:49)
       at com.facebook.react.animated.NativeAnimatedNodesManager.runUpdates(NativeAnimatedNodesManager.java:453)
       at com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded(NativeAnimatedModule.java:117)
       at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
       at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:824)
       at android.view.Choreographer.doCallbacks(Choreographer.java:605)
       at android.view.Choreographer.doFrame(Choreographer.java:574)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:812)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6918)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Additional Information

  • React Native version: 0.42
  • Platform: Android
  • Operating System: MacOS
  • Dev tools: Android Studio 2.3
Locked

Most helpful comment

We are seeing the same issue in our production RN app. We are on version 0.42.3 and, as already stated, it only happens on Android.

Any pointers in which direction to look, would be extremely appreciated.

Here is our stacktrace, but it is pretty much identical to the one @rayshih posted.

java.lang.IllegalStateException: Node has not been attached to a view
    at com.facebook.react.animated.PropsAnimatedNode.updateView(PropsAnimatedNode.java:49)
    at com.facebook.react.animated.NativeAnimatedNodesManager.runUpdates(NativeAnimatedNodesManager.java:453)
    at com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded(NativeAnimatedModule.java:117)
    at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
    at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:869)
    at android.view.Choreographer.doCallbacks(Choreographer.java:683)
    at android.view.Choreographer.doFrame(Choreographer.java:616)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6154)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

All 17 comments

Same here

+1

+1

We are seeing the same issue in our production RN app. We are on version 0.42.3 and, as already stated, it only happens on Android.

Any pointers in which direction to look, would be extremely appreciated.

Here is our stacktrace, but it is pretty much identical to the one @rayshih posted.

java.lang.IllegalStateException: Node has not been attached to a view
    at com.facebook.react.animated.PropsAnimatedNode.updateView(PropsAnimatedNode.java:49)
    at com.facebook.react.animated.NativeAnimatedNodesManager.runUpdates(NativeAnimatedNodesManager.java:453)
    at com.facebook.react.animated.NativeAnimatedModule$1.doFrameGuarded(NativeAnimatedModule.java:117)
    at com.facebook.react.uimanager.GuardedChoreographerFrameCallback.doFrame(GuardedChoreographerFrameCallback.java:32)
    at com.facebook.react.uimanager.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:131)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:869)
    at android.view.Choreographer.doCallbacks(Choreographer.java:683)
    at android.view.Choreographer.doFrame(Choreographer.java:616)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6154)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

Had this issue when trying to access to this.props in a constructor (yeah I've been dumb..), if that can help..

I have this issue on IOS too

I've seen this happen when I rename a method in a component but I forget to update this.method = this.method.bind(this) in the constructor and pass this method as a property to a child component.

+1

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

Problem still persist on ^0.48.4",

Problem still persist on 0.48.4

The same issue in 0.47.2

FYI: This commit https://github.com/facebook/react-native/commit/2b4ff6ea19dc674cf035ee419daa132cde8d1f5e#diff-ed80d5990dea7c0f1947e73bb23569ddL49 is part of the react-native release 0.51.0 and changed the assertion / exception / behaviour.

With this version _this_ exception should not happen anymore. I hadn't time to verify this with our app, which has many of these crashes, too.

@jerolimov Did updating to 0.51 solve your issues?

You should check any type of error, mainly a Type or Reference error. This is a silent error, it does not appear in React Packager, therefore, check any hints in your console. In my experience, when I have this is a consequense of another error, therefore, it is not able to mount the node.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aniss picture aniss  路  3Comments

upbit picture upbit  路  3Comments

grabbou picture grabbou  路  3Comments

despairblue picture despairblue  路  3Comments

anchetaWern picture anchetaWern  路  3Comments