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

Android Crashing on RN 50.4 with illegalViewOperationException #17092

Closed
gavin-gmlab opened this issue Dec 6, 2017 · 6 comments
Closed

Android Crashing on RN 50.4 with illegalViewOperationException #17092

gavin-gmlab opened this issue Dec 6, 2017 · 6 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@gavin-gmlab
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.5
Node: 7.9.0
Yarn: 1.3.2
npm: 4.2.0
Watchman: 4.9.0
Xcode: Xcode 8.2.1 Build version 8C1002
Android Studio: 3.0 AI-171.4408382

Packages: (wanted => installed)
react: 16.1.1 => 16.1.1
react-native: 0.50.4 => 0.50.4

Target Platform: Android 6.0.1

-->

Steps to Reproduce

Launch the app normally. Occasionally the app crashes on launch. Reproduced on XiaoMi Mi5 and Samsung Galaxy S5

So far not reproduced on emulator

Expected Behavior

The app should launch normally

Actual Behavior

App crashes on actual device with the following message:
com.facebook.react.uimanager.illegalViewOperationException: trying to set local data for view with unknown tag

Don't seem to be able to reproduce on emulator, but do see these warnings on iOS emulator when executing the same scenario (launching a logged in app)

2017-12-06 11:36:07.498 [warn][tid:main][RCTUIManager.m:462] Warning: Overriding previous layout animation with new one before the first began:
<RCTLayoutAnimationGroup: 0x60800024e8b0; creatingLayoutAnimation: (null); updatingLayoutAnimation: <RCTLayoutAnimation: 0x60800086d280; duration: 0.250000; delay: 0.000000; property: (null); springDamping: 0.000000; initialVelocity: 0.000000; animationType: 5;>; deletingLayoutAnimation: (null)> -> <RCTLayoutAnimationGroup: 0x608000257610; creatingLayoutAnimation: <RCTLayoutAnimation: 0x60800067e300; duration: 0.300000; delay: 0.000000; property: opacity; springDamping: 0.000000; initialVelocity: 0.000000; animationType: 4;>; updatingLayoutAnimation: <RCTLayoutAnimation: 0x60800067ed80; duration: 0.300000; delay: 0.000000; property: (null); springDamping: 0.000000; initialVelocity: 0.000000; animationType: 4;>; deletingLayoutAnimation: <RCTLayoutAnimation: 0x60800067ec00; duration: 0.300000; delay: 0.000000; property: opacity; springDamping: 0.000000; initialVelocity: 0.000000; animationType: 4;>>.
2017-12-06 11:36:07.521 [warn][tid:main][RCTView.m:610] (ADVICE) View #424 of type RCTView has a shadow set but cannot calculate shadow efficiently. Consider setting a background color to fix this, or apply the shadow to a more specific component.

Reproducible Demo

I'm not sure which part of the code actually produces this problem as it seem like some transition problem. Doesn't happen all the time either - once the app is launched successfully, no other problems until trying to launch again, where the app could launch properly, or it crashes again. So far not reproducable on emulator

App.js render method

  render () {
    return (
      <Provider store={store}>
        <RootContainer />
      </Provider>
    )
  }

Root Container render method (Note: using react native router flux v3.43)

  render () {
    return (
      <View style={styles.applicationView}>
        <StatusBar barStyle='light-content' />
        <NavigationRouter />
        <Overlay profile={this.props.overlayText} />}
      </View>
    )
  }

Overlay render method

  render(){
    return <View pointerEvents='none' style={{ flexDirection: 'column',flex: 1, zIndex: 1, position: 'absolute',
        top: 0,
        bottom: 0,
        left: 0,
        right: 0}}>{
      this.state.images.map((img, i) =>{
        return img
      })
    }</View>
  }

Startup (Splash Screen) code

class SplashScreen extends React.Component {

  constructor (props) {
    super(props)
    this.image = Images.logo
    this.startupComplete = this.props.startupComplete
  }

  componentWillReceiveProps (nextProps) {
    if (nextProps.startupComplete !== this.startupComplete) {
      this.nextScreen()
    }
  }

  componentDidMount () {
    if (this.props.startupComplete) {
      this.nextScreen()
    } else {
      setTimeout(this.nextScreen.bind(this), screenTimeout)
    }
  }

  nextScreen () {
    if (this.props.credentials && this.props.credentials.token) { // Go to login screen if token is empty, otherwise go to main screen
      NavigationActions.mainScreen({type: 'reset'})
    } else {
      NavigationActions.loginScreen({type: 'reset'})
    }
  }

  render () {
    return (
      <View style={styles.centered}>
        <Image source={this.image} style={styles.logo} />
      </View>
    )
  }
}


const mapStateToProps = (state) => {
  return {
    startupComplete: state.login.startupComplete,
    credentials: state.login.credentials
  }
}

MainScreen render method

  render () {
    return (
      <View style={{flex: 1, backgroundColor: 'transparent', flexDirection: 'column', alignSelf: 'stretch'}}>
        <View style={{position: 'absolute', top: 55, bottom: 0, left: 0, right: 0}}>
          <AlertMessage title='No Messages to Display' show={this._noRowData()} />
          <SwipeListView
            contentContainerStyle={styles.listContent}
            dataSource={this.state.dataSource}
            renderRow={this._renderRow}
            enableEmptySections
            pageSize={15}
          />
          <View style={styles.footer}>
            <NavFooter />
          </View>
          <ActionButton buttonColor='rgba(231,76,60,1)' offsetY={60} position='right' >
            <ActionButton.Item textStyle={{fontSize: Fonts.size.small}} buttonColor='green' title={I18n.t('newItem')} onPress={() => this.onCreateItem()}>
              <Icon
                name='comment-o'
                type='font-awesome'
                style={styles.actionButtonIcon}
                color={Colors.bluebtn}
              />
            </ActionButton.Item>
            <ActionButton.Item textStyle={{fontSize: Fonts.size.small}} buttonColor='blue' title={I18n.t('newGroup')} onPress={() => this.multipleItems()}>
              <Icon
                name='bullhorn'
                type='font-awesome'
                style={styles.actionButtonIcon}
                color={Colors.bluebtn}
              />
            </ActionButton.Item>
          </ActionButton>
        </View>
      </View>
    )
  }
@Noitidart
Copy link

I am getting a crash in RN 51 too. I'm new to maps, I just copied pasted the example after putting my maps api key in the android manifest.

@SudoPlz
Copy link
Contributor

SudoPlz commented Dec 7, 2017

Same here. Can you post your package.json to find out if we have any libraries in common?
Here's mine:

"dependencies": {
    "axios": "0.17.1",
    "babel-preset-react-native": "2.0.0",
    "bugsnag-react-native": "2.7.3",
    "clone": "^2.1.1",
    "creditcards": "^2.1.2",
    "currency-formatter": "1.3.1",
    "eslint-config-airbnb": "16.0.0",
    "immutable": "3.8.2",
    "instabug-reactnative": "^2.0.15",
    "key-mirror": "github:SudoPlz/key-mirror",
    "moment": "2.19.2",
    "moment-timezone": "0.5.14",
    "normalize-css-color": "^1.0.2",
    "performance-now": "2.1.0",
    "prop-types": "15.6.0",
    "querystring": "0.2.0",
    "react": "16.0.0-beta.5",
    "react-clone-referenced-element": "^1.0.1",
    "react-native": "0.49.5",
    "react-native-action-button": "2.8.3",
    "react-native-amplitude-analytics": "^0.1.10",
    "react-native-animatable": "1.2.4",
    "react-native-background-timer": "1.3.0",
    "react-native-blur": "^3.2.2",
    "react-native-code-push": "5.2.0-beta",
    "react-native-collapsible": "^0.9.0",
    "react-native-fcm": "10.0.3",
    "react-native-fetch-blob": "0.10.8",
    "react-native-i18n": "2.0.9",
    "react-native-image-picker": "0.26.7",
    "react-native-image-progress": "1.0.1",
    "react-native-keyboard-aware-scrollview": "github:SudoPlz/react-native-keyboard-aware-scrollview",
    "react-native-keychain": "1.2.1",
    "react-native-linear-gradient": "2.3.0",
    "react-native-maps": "^0.17.1",
    "react-native-modal-datetime-picker": "^4.13.0",
    "react-native-modalbox": "^1.4.2",
    "react-native-navigation": "1.1.295",
    "react-native-orientation": "github:yamill/react-native-orientation",
    "react-native-pages": "^0.6.1",
    "react-native-picker": "4.3.0",
    "react-native-root-toast": "^2.2.0",
    "react-native-simple-store": "1.3.0",
    "react-native-store-review": "^0.1.3",
    "react-native-swipeout": "github:SudoPlz/react-native-swipeout",
    "react-native-vector-icons": "4.4.2",
    "react-native-version-check": "^2.0.1",
    "react-native-wheel-picker": "github:SudoPlz/react-native-wheel-picker",
    "react-redux": "5.0.6",
    "react-test-renderer": "16.0.0",
    "redux": "3.7.2",
    "redux-thunk": "2.2.0",
    "rn-snoopy": "^2.0.0",
    "uglify-js": "3.2.0",
    "undefined": "0.1.0",
    "underscore": "latest",
    "url-parse": "1.2.0",
    "validate.js": "0.12.0"
  },
  "devDependencies": {
    "eslint": "^4.12.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-jsx-a11y": "^6.0.2",
    "eslint-plugin-react": "^7.5.1",
    "jest-cli": "^21.2.1",
    "remote-redux-devtools": "^0.5.12",
    "remotedev-server": "^0.2.4",
    "whatwg-fetch": "2.0.3"
  }

@AlessandroAnnini
Copy link

@henrikra
Copy link

Is this the same bug?

com.facebook.react.uimanager.IllegalViewOperationException Trying to add unknown view tag: 430 
    UIImplementation.java:396 com.facebook.react.uimanager.UIImplementation.setChildren
    UIManagerModule.java:310 com.facebook.react.uimanager.UIManagerModule.setChildren
    Method.java:-2 java.lang.reflect.Method.invoke
    JavaMethodWrapper.java:363 com.facebook.react.bridge.JavaMethodWrapper.invoke
    JavaModuleWrapper.java:162 com.facebook.react.bridge.JavaModuleWrapper.invoke
    NativeRunnable.java:-2 com.facebook.react.bridge.queue.NativeRunnable.run
    Handler.java:789 android.os.Handler.handleCallback
    Handler.java:98 android.os.Handler.dispatchMessage
    MessageQueueThreadHandler.java:31 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
    Looper.java:164 android.os.Looper.loop
    MessageQueueThreadImpl.java:194 com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run
    Thread.java:764 java.lang.Thread.run

@AlessandroAnnini
Copy link

AlessandroAnnini commented Dec 13, 2017

@henrikra actually not, maybe i'm wrong too because my error is like this:
com.facebook.react.uimanager.IllegalViewOperationException: ViewManager for tag 93 could not be found
and it is different from yours and from the one in the issue....

@stale
Copy link

stale bot commented Feb 11, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 11, 2018
@stale stale bot closed this as completed Feb 18, 2018
@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants