question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android - App crashes with ReactRootView inside viewpager

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

13reactions
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.

2reactions
mac-cain13commented, Mar 1, 2018

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Crashes on using Tab Views in Android - Stack Overflow
Add these lines to your activity's theme in styles.xml <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item>.
Read more >
ViewPager NullPointerException when onPause is called from ...
I have tried all imposible solution but my app still crash...
Read more >
Developers - V8 Runtime platform crash issue - - Bountysource
For Android,I embed V8 into ReactNative Sdk, And Found an issue. 1. Environment: ViewPager with Two Fragment:Fragment A & Fragment B, Every Fragment...
Read more >
react-native | Yarn - Package Manager
5 vulnerabilities. A framework for building native apps using React ... React Native brings React's declarative UI framework to iOS and Android.
Read more >
React Native March 2018 (v0.55.0) released
Android specific fixes. Fix: incorrect line-height calculation (74e54cb by @strindhaug); Fix crashes with TextInput introduced in 0.53 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found