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

Android - App crashes with ReactRootView inside viewpager #17123

Closed
tdekoning opened this issue Dec 8, 2017 · 7 comments
Closed

Android - App crashes with ReactRootView inside viewpager #17123

tdekoning opened this issue Dec 8, 2017 · 7 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@tdekoning
Copy link
Contributor

tdekoning commented Dec 8, 2017

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Steps to Reproduce

(Write your steps here:)

  1. Create a native ViewPager with a ReactRootView as content, preferably with some images inside the ReactRootView
  2. Swipe fast
  3. See this stack trace

Expected Behavior

I would expect no stack trace or errors to occur.

Actual Behavior

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.uimanager.ReactShadowNode.addChildAt(com.facebook.react.uimanager.ReactShadowNode, int)' on a null object reference
       at com.facebook.react.uimanager.UIImplementation.setChildren(UIImplementation.java:472)
       at com.facebook.react.uimanager.UIManagerModule.setChildren(UIManagerModule.java:436)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:158)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
       at java.lang.Thread.run(Thread.java:818)

This occurs after swiping through the ViewPager quickly.

Reproducible Demo

Proposed fix:
Below this line of code: Add the same fix as this one

@stale
Copy link

stale bot commented Feb 20, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 20, 2018
@stale stale bot closed this as completed Feb 27, 2018
@mac-cain13
Copy link

Think this issue is still relevant and even a fix is proposed. Is there anyone from the team that can apply this fix or confirm that this fix would be the right thing to do so someone else can create a PR?

@ssuchanowski
Copy link

Do you have anywhere demo you used to reproduce this?

I get this exception on prod and the change you are proposing looks reasonable but I cannot reproduce it.

@Frank1234
Copy link

Frank1234 commented May 13, 2018

Here is a very simple demo project that reproduces this bug: #19233 . Sadly, it reproduces not only this bug, but many other bugs as well, in a random manner.

@SudoPlz
Copy link
Contributor

SudoPlz commented May 14, 2018

So what is happening is, react-native is trying to manipulate a view (with setChildren) but that view is not found within the node array.

This is an issue I've been facing for a long time but have NO idea how to resolve.
The proposal does not fix the issue, it just outputs a better error log, but the issue remains..

@Frank1234
Copy link

@patrickkempff
Copy link
Contributor

#20025 should fix this

@facebook facebook locked as resolved and limited conversation to collaborators Feb 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

6 participants