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

ReactRootViews in Android Viewpager crash #19233

Closed
3 tasks done
Frank1234 opened this issue May 12, 2018 · 3 comments
Closed
3 tasks done

ReactRootViews in Android Viewpager crash #19233

Frank1234 opened this issue May 12, 2018 · 3 comments
Labels
Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Frank1234
Copy link

When I add ReactRootViews to a ViewPager in Android, the app crashes if I switch pages quickly for a while. Example app: https://github.com/Frank1234/RNViewPager

Environment

OS: macOS High Sierra 10.13.3
Node: 9.4.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: Not Found
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Steps to Reproduce

Run my sample app, press the floating action button. https://github.com/Frank1234/RNViewPager

Expected Behavior

App should quickly switch pages for a while.

Actual Behavior

On clean install this sometimes goes well, if so: close the app (hard close), open it again and try once more. Now it will definately crash. App crashes with one of these stack traces:

com.rnviewpager E/unknown:ReactNative: Exception in native call
    java.lang.NullPointerException: Attempt to invoke interface method 'com.facebook.react.uimanager.ThemedReactContext com.facebook.react.uimanager.ReactShadowNode.getThemedContext()' on a null object reference
        at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:282)
        at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:366)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:164)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
com.rnviewpager E/unknown:ReactNative: Exception in native call
    com.facebook.react.uimanager.IllegalViewOperationException: View with tag 631 is not registered as a root view
        at com.facebook.react.uimanager.ShadowNodeRegistry.removeRootNode(ShadowNodeRegistry.java:42)
        at com.facebook.react.uimanager.UIImplementation.removeRootShadowNode(UIImplementation.java:226)
        at com.facebook.react.uimanager.UIImplementation.removeRootView(UIImplementation.java:218)
        at com.facebook.react.uimanager.UIManagerModule.removeRootView(UIManagerModule.java:326)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:164)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
com.rnviewpager E/unknown:ReactNative: Exception in native call
    java.lang.NullPointerException: Attempt to invoke interface method 'int com.facebook.react.uimanager.ReactShadowNode.getReactTag()' on a null object reference
        at com.facebook.react.uimanager.UIImplementation.updateViewHierarchy(UIImplementation.java:686)
        at com.facebook.react.uimanager.UIImplementation.dispatchViewUpdates(UIImplementation.java:654)
        at com.facebook.react.uimanager.UIManagerModule.onBatchComplete(UIManagerModule.java:665)
        at com.facebook.react.bridge.NativeModuleRegistry.onBatchComplete(NativeModuleRegistry.java:134)
        at com.facebook.react.bridge.CatalystInstanceImpl$BridgeCallback.onBatchComplete(CatalystInstanceImpl.java:145)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:164)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)

com.rnviewpager E/unknown:ReactNative: Exception in native call
    com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag: 370
        at com.facebook.react.uimanager.UIImplementation.setChildren(UIImplementation.java:480)
        at com.facebook.react.uimanager.UIManagerModule.setChildren(UIManagerModule.java:441)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:164)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
com.rnviewpager E/unknown:ReactNative: Exception in native call
    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:482)
        at com.facebook.react.uimanager.UIManagerModule.setChildren(UIManagerModule.java:441)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:164)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:764)
@Frank1234 Frank1234 changed the title ReactRootViews in Android Viewpager ReactRootViews in Android Viewpager crash May 12, 2018
@react-native-bot react-native-bot added the Platform: Android Android applications. label May 12, 2018
@Frank1234
Copy link
Author

@stale
Copy link

stale bot commented Sep 5, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. 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 Sep 5, 2018
@stale
Copy link

stale bot commented Sep 12, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Sep 12, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Sep 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. 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

2 participants