-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.uimanager.ReactShadowNode.setStyleWidth(float)' on a null object reference #10845
Comments
I have found the same issue on release APK alse see #10795 |
@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 |
1 similar comment
@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 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 |
@akzhou can you push an PR to facebook? |
+1 |
1 similar comment
+1 |
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:
|
@Proberts can you create an app that reproduces this issue on https://rnplay.org and then attach it to #10795? |
@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? |
@Proberts yeah that would probably be useful for react-native devs to have a way to reproduce it. |
+1 |
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. |
This problem is fresh. +1 |
We're also encountering this crash on Google Android emulators API 23, RN 0.35 with automated runs via Calabash. We haven't seen it (yet thankfully?) on physical devices, but it's pretty annoying to have our automation fail so randomly. It also happens around the time of a modal display. |
I am having the same issue. I have modal (fullscreen) and android keyboard on. It happens when I close it with enter key (onSubmitEditing). I've tried to close modal in |
I have the same question on React Native |
+1 |
Any updates? |
1 similar comment
Any updates? |
Yeah this bug is pretty nasty, i've got 2 bad reviews in play store because of it ...
Nothing fancy, but works okay |
I have the same question on React Native |
+1 |
I haven't seen this problem since I upgraded to 0.39.2 It might have been fixed by this commit |
I've just seen it with 0.41-rc |
Experiencing this randomly on startup as well. 0.4.0 |
+1 with version 0.40 |
@grabbou This should be pretty safe to merge, what release can we get this into do you think? |
Yeah, I'll include it in next RC tomorrow. |
Patch Error: ReactShadowNode.setStyleWidth(float)' on a null object reference facebook#10845 facebook/react-native@5873a22
I added a delay of 1 second before showing the infected view page, which solved the issue temporarily |
I think it is related to react-native-router-flux |
I have not been able to run this release. I followed the documentation located here to upgrade to this release version you mentioned in your post, but when I try to do 'react-native run-android', this is what I get (see below). Is there any documentation for how to install one of these release versions?
|
@itcurves Do you have resolved this problem? |
Is this issue already fixed in the latest release? Because I just checked my crashlytics and this issue seems to appear quite often. |
So this commit is not in RN 0.43? |
…er JS has removed it Summary: See #10845 onSizeChanged is enqueueing a runnable from the ui thread that references a shadow view by id on the native modules thread. Since the shadow thread 'runs ahead' of the UI thread (e.g. it has a newer state of the world than the UI thread), this isn't safe. By the time that code block runs, it's possible that an update from JS has already removed that view from the shadow hierarchy (a change which would then propagate to the native hierarchy on the UI thread). Reviewed By: AaaChiuuu Differential Revision: D4706521 fbshipit-source-id: 0915f081068709b895f70b2edce12163b39e5456
Looks like the commit didn't end up in 0.43 release by a mistake. I have
released a new version (0.43.3) along with some other smaller tweaks.
…On Mon, 10 Apr 2017 at 07:16 tianxind ***@***.***> wrote:
So this commit is not in RN 0.43?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10845 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWcxkgG5jsmLZWEWvcEXF3xrKMfBofzks5rubsTgaJpZM4KuSyA>
.
|
anyone confirm that this is fixed for RN 0.44? |
Any update? We have the same issue with RN 0.41.2 |
Yes, .44 should be fine as it's listed in the release notes: https://github.com/facebook/react-native/releases/tag/v0.44.0 |
…er JS has removed it Summary: See facebook#10845 onSizeChanged is enqueueing a runnable from the ui thread that references a shadow view by id on the native modules thread. Since the shadow thread 'runs ahead' of the UI thread (e.g. it has a newer state of the world than the UI thread), this isn't safe. By the time that code block runs, it's possible that an update from JS has already removed that view from the shadow hierarchy (a change which would then propagate to the native hierarchy on the UI thread). Reviewed By: AaaChiuuu Differential Revision: D4706521 fbshipit-source-id: 0915f081068709b895f70b2edce12163b39e5456
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) |
+1 |
3 similar comments
+1 |
+1 |
+1 |
@astreet not sure if you have any input on this. I have the same issue as @39otrebla described. |
Still happening in 0.49.5 |
The issue is still here, unfortunately. |
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
The text was updated successfully, but these errors were encountered: