-
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
com.facebook.react.uimanager.IllegalViewOperationException #17178
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Having same issue, some times random crash on navigation reset EDIT: I think it was because I'm using wix navigation (react-native-navigation) |
same here |
Same:
|
This comment has been minimized.
This comment has been minimized.
May also be because you have a modal or lightbox that needs to be dismissed first |
This comment has been minimized.
This comment has been minimized.
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
Can anyone confirm that it has been fixed in most recent RN version? |
This comment has been minimized.
This comment has been minimized.
Any hint on where to look? I have a hybrid Java + RN app and so far I cannot reproduce it on my devices (different ones are shipping now) but we get a lot of those exceptions on production. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I was doing a navigation reset with a modal or lightbox open, after dismissing it before reseting nav it was fixed, but Im not sure if thats the cause |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Here is a very simple demo project that reproduces this bug: #19233 . Sadly, it reproduces not only this bug, but many other bugs as well, in a random manner. But clicking the button in the app a few times will definitely cause this exact exception. |
I managed to spot exactly what's causing that problem in So what happens behind the scenes is, Specifically UIImplementation manipulates that list with the following methods
so if any of those get invoked at the same time, there's a really high chance that the app will crash. In our app we fixed that issue by providing a custom https://gist.github.com/SudoPlz/23ea2dee9772cb39e1e742034cdf8b98 as you can see we don't allow those UIImplementation methods to run unsynchronised anymore. We could constantly reproduce the issue on our end, but now that's totally fixed. I hope this post helps others, because it really took me A CRAZY amount of time to figure this out. I really wonder though, is there a reason the facebook team kept that code unsynchronized? |
If you don't know how to pass a new private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
...bla bla blah and add the following function: protected UIImplementationProvider getUIImplementationProvider() {
return new YourCustomUIImplementationProvider();
} so that it now looks like this: private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
protected UIImplementationProvider getUIImplementationProvider() {
return new YourCustomUIImplementationProvider();
}
...bla bla blah |
@SudoPlz if you want the core team to do something you will probably need to create a new issue or PR; they may not look at closed issues. This code should be the default, right? I don't think users should have to do anything on their end to prevent this crash. |
Yeah, I think this should be default behaviour.. I'll open a PR later on. |
@SudoPlz Thank you very much and great work! I hope that your PR will be accepted asap! |
@SudoPlz did you create a pr to fix this problem? |
…ode children sparse array - Fixes: facebook#17178 (comment)
It seems Android doesn't like converting non-Boolean values into booleans. So I'm now ensuring that all values which I'm using as booleans are in fact, booleans. I have changed all occurrences similar to this where
…into one of these which converts
|
Summary: @public This diff deprecates and deletes the UIImplementationProvider class. It is not required to create an UIImplementation provider anymore, from now on the UIImplementation is created inside the UIManagerModule. If you are using the UIImplementationProvider to create a ReactInstanceManager e.g.: ``` ReactInstanceManager = getReactInstanceManagerBuilder() ... .setUIImplementationProvider(...) ... .build(); ``` Then you should just remove that line: ``` ReactInstanceManager = getReactInstanceManagerBuilder() .set..... .build(); ``` Reviewed By: achen1 Differential Revision: D8650376 fbshipit-source-id: 8d883295d8bf6578a99685edf6a2a84c6d0df0cf
…ode children sparse array - Fixes: facebook#17178 (comment)
…ode children sparse array - Fixes: facebook#17178 (comment)
…ode children sparse array - Fixes: facebook#17178 (comment)
Is this a bug report?
Yeah.
Have you read the Contributing Guidelines?
Yeah.
Environment
Environment:
OS: macOS High Sierra 10.13.1
Node: 8.9.2
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.3 => 0.50.3
Steps to Reproduce
LayoutAnimation
to some of your componentsExpected Behavior
The
UIImplementation
is trying to add someView
which is not there yet.Actual Behavior
Logs:
Backstory
I have developed with RN for over a year now. And this crash has been there always. Some people say it is related to LayoutAnimation but I have gotten it already before that. Recently there were fix commits to similar issue f2c6877 But I think they don't fix this because looks like the lines that can have this crash are here: https://github.com/facebook/react-native/search?utf8=%E2%9C%93&q=%22Trying+to+add%22&type=
This crash has been so long in RN so maybe it would be time to fix it? Tell me if there is anything I could do for help :)
Reproducible Demo
Unfortenately I can't reproduce this on my Android :(
Similar issues:
#13984
#17092
#16412
#14944
#14768
#10745
The text was updated successfully, but these errors were encountered: