Description
Android tablet,when I assembleRelease the apk,modal view crash. debug not found this question.
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.uimanager.ReactShadowNode.setStyleWidth(float)' on a null object reference at com.facebook.react.uimanager.UIImplementation.updateNodeSize(UIImplementation.java:151) at com.facebook.react.uimanager.UIManagerModule.updateNodeSize(UIManagerModule.java:213) at com.facebook.react.views.modal.ReactModalHostView$DialogRootViewGroup$1.run(ReactModalHostView.java:302) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) at android.os.Looper.loop(Looper.java:194) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196) at java.lang.Thread.run(Thread.java:818)
Additional Information
- React Native version: 0.36.1,0.37
- Platform: android
- Operating System: mac os
Activity
ettysekhon commentedon Nov 11, 2016
I have found the same issue on release APK alse see #10795
ettysekhon commentedon Nov 11, 2016
@akzhou I solved this by using the InteractionManager runAfterInteractions in a ComponentDidMount, see below for further details:
https://github.com/brentvatne/run-after-interactions-exp/blob/master/index.js
ettysekhon commentedon Nov 11, 2016
@akzhou I solved this by using the InteractionManager runAfterInteractions in a ComponentDidMount, see below for further details:
https://github.com/brentvatne/run-after-interactions-exp/blob/master/index.js
akzhou commentedon Nov 16, 2016
@ettysekhon it seem that you use renderPlaceholder replace modal view.at last,I fix it by compile the react-native source code with modify ReactModalHostView.java onSizeChanged method
protected void onSizeChanged(final int w, final int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); return }
i don't know how the code work,at least no crash
xujinyang commentedon Nov 22, 2016
@akzhou can you push an PR to facebook?
nadeermalangadan commentedon Nov 22, 2016
+1
bawn commentedon Nov 25, 2016
+1
Proberts commentedon Nov 29, 2016
This fix looks like it removes some important functionality.
FWIW I have this reproducible using redux and saga. I have a bool state variable mapped to a Modal component's 'visible" property. I change the state from false to true at the start of the saga. If I change the state back to false in the same saga I get this error consistently.
It seems like a safer band-aid would be to put a null test at line 151 (RN 0.37) in UIImplementation.java:
idris commentedon Nov 29, 2016
@Proberts can you create an app that reproduces this issue on https://rnplay.org and then attach it to #10795?
Proberts commentedon Nov 29, 2016
@idris Trying but it looks like I can't import redux-saga. Not sure how to implement it without as I'm new to RN. I can try to make a minimal app that shows the problem and stick it on github. Would that help?
idris commentedon Dec 1, 2016
@Proberts yeah that would probably be useful for react-native devs to have a way to reproduce it.
jjdp commentedon Dec 8, 2016
+1
Proberts commentedon Dec 8, 2016
FWIW I can't get it to reproduce in a minimal setup with the way I thought it was getting triggered in my code. I had it go away for a while after I moved some code being called from an onPress event handler into a saga. But it came back after I added to async calls to the saga - so at least I have a place to start looking.
jideobs commentedon Dec 8, 2016
This problem is fresh. +1
66 remaining items
astreet commentedon May 10, 2017
Yes, .44 should be fine as it's listed in the release notes: https://github.com/facebook/react-native/releases/tag/v0.44.0
Fix crash if native code tries to update the size of a modal view aft…
39otrebla commentedon Sep 15, 2017
Still happening on my side, without using any Modal (I am using react native navigation and its built-in Modal).
platform: Android (min api 21)
react-native: 0.48.3
couldhll commentedon Nov 22, 2017
+1
mehmetcanker commentedon Nov 22, 2017
+1
Shinichi52 commentedon Nov 27, 2017
+1
etruta commentedon Dec 19, 2017
+1
fxalvarezd commentedon Jan 29, 2018
@astreet not sure if you have any input on this. I have the same issue as @39otrebla described.
It's really random on our end and almost never happens, but when it does it's when transitioning to a screen.
We're running
react-native: 0.48.4
andreact-native-navigation: ^1.1.300
.Remove LoadingMask for now, since Modal got issue in Android of 0.42.3
wenkangzhou commentedon Jun 1, 2018
Still happening in 0.49.5
8of commentedon Jul 12, 2018
The issue is still here, unfortunately.
React Native 0.55.4, 0.56.0
Android 8