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
NullPointerException when showing Android Modal #10795
Comments
@facebook-github-bot label Android |
I have the same question on React Native version: v0.36.1 |
Hi, hope this helps with solving the problem |
Looks like @Proberts has a way to reproduce this: #10845 (comment) |
Same issue in RN 0.39.0. It happens randomly, but seems to be triggered by |
+1 |
I only experience this crash on QA or prod builds for some reason. But yeah, this still needs a solution(v0.39). |
My company needed a fix for this, as this crash was happening in production and it was vital we fixed it, but we were unable to come up with a good method of testing and fixing this issue. We managed to "fix" the issue by ripping out the Modal component from our code. In our case, Modal was used to show a loading indicator. We definitely need a true fix for this issue though. |
+1, This happens for me even if |
I get this crash randomly while using react-native-loading-spinner-overlay |
any updates on this? |
@gsaandy after using a custom version compiled from master, the problem is gone for me. |
Any workaround for this now? |
Seems fixed in latest 0.44.0 release (5873a22) |
Then let's close this, if it happens again please open a new issue. |
@facebook-github-bot close |
@charpeni tells me to close this issue. If you think it should still be opened let us know why. |
@JakeRawr I've met this problem, too. |
Description
We are getting a NullPointerException sometimes upon trying to show a modal (see "Reproduction" section for details).
Stack Trace:
It sounds like this commit may be related, and may have fixed a similar issue: 922cd6d
From that commit message:
The part about "dialog is created, but there are no actual views in it" makes me feel it's related, because the NullPointerException happens here: https://github.com/facebook/react-native/blob/v0.36.0/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java#L301-L302
So apparently
getChildAt(0).getId()
returns an ID that is unavailable by the timesetStyleWidth
is called.Reproduction
Unfortunately, it's a tough case to reproduce. Even in our app it only happens about half the time. We have one modal show first, and when the user clicks "OK" on that one, we show another "saving" modal, then when saving is complete we remove the modal. It seems in between the user clicking "OK" and the "saving" modal displaying, we get a crash (about half the time).
Additional Information
The text was updated successfully, but these errors were encountered: