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

com.facebook.react.uimanager.IllegalViewOperationException in Layout.java:1912 #4262

Closed
aksonov opened this issue Oct 14, 2019 · 4 comments
Closed

Comments

@aksonov
Copy link
Contributor

aksonov commented Oct 14, 2019

Error in tinyrobot

com.facebook.react.uimanager.IllegalViewOperationException in Layout.java:1912

View on Bugsnag

Stacktrace

ReactRootView.java:601 - com.facebook.react.ReactRootView.handleException

View full stacktrace

Created by bengtan via Bugsnag

@bengtan
Copy link
Contributor

bengtan commented Oct 15, 2019

I think this is some sort of error that only occurs on old android devices. I vaguely remember something similar when running on an old 4.4 device. At the time, the app seemed to recover on it's own so it didn't seem important/urgent.

@bengtan
Copy link
Contributor

bengtan commented Oct 15, 2019

@bengtan
Copy link
Contributor

bengtan commented Oct 15, 2019

Possibly related:

React Native StackOverflowException
https://stackoverflow.com/questions/53704643

IllegalViewOperationException: Trying to add unknown view tag #2892
wix/react-native-navigation#2892

Specifically:

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 foo may not be true or false:

{foo && <MyComponent />}

…into one of these which converts foo into a boolean if it is not:

{!!foo && <MyComponent />}
{Boolean(foo) && <MyComponent />}

wix/react-native-navigation#2892 (comment)

Just in case someone else lands here and none of the above works I will add what worked for me.
I had the same error and started removing lines until it didn't happen anymore. Lo and behold - the last line I deleted was <View> <MyComponent /> </View> Did you notice the spaces surrounding MyComponent? It was a Homer moment for me

wix/react-native-navigation#2892 (comment)

@bengtan
Copy link
Contributor

bengtan commented Oct 24, 2019

Not QA-able. bengtan to monitor via bugsnag.

@bengtan bengtan closed this as completed Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants