title: TaskQueue: Error with task: undefined is not an object (evaluating '_this.view._component.measureInWindow') in react native
body: <p>I am very new to react native, I am facing this issue with very simple demo app while handling screen navigation 
  Getting this error message
  TaskQueue: Error with task: undefined is not an object (evaluating '_this.view._component.measureInWindow')</p>
  
  <p>Here is screen shot of error :</p>
  
  <p><a href="https://i.stack.imgur.com/ZtxmM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZtxmM.png" alt="enter image description here"></a></p>
  
  <p>here is my code
  App.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import React, {Component} from 'react';
  import {createStackNavigator} from 'react-navigation';
  import HomeActivity from './components/HomeActivity';
  import ProfileActivity from './components/ProfileActivity';
  const RootStack = createStackNavigator(
    {
      Home: {
        screen: HomeActivity,
      },
      Profile: {
        screen: ProfileActivity,
      },
    },
    {
      initialRouteName: 'Home',
    },
  );
  export default class App extends Component {
    render() {
      return(
      &lt;RootStack /&gt;
      );
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>HomeActivity.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import React, {Component} from 'react';
  import {StyleSheet, Text, View, Button} from 'react-native';
  class HomeActivity extends Component {
    static navigationOptions = {
      title: 'Home',
      headerStyle: {backgroundColor: '#03A9F4'},
      headerTintColor: '#fff',
      headerTitleStyle: {fontWeight: 'bold'},
    };
    render() {
      return (
        &lt;View style={styles.container}&gt;
          &lt;Text style={styles.headerText}&gt;Home Activity&lt;/Text&gt;
          &lt;Button
            title="Go to Profile Activity"
            onPress={() =&gt; this.props.navigation.navigate('Profile')}
          /&gt;
        &lt;/View&gt;
      );
    }
  }
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center',
      backgroundColor: '#F5FCFF',
    },
    headerText: {
      fontSize: 20,
      textAlign: 'center',
      margin: 10,
      fontWeight: 'bold',
    },
  });
  export default HomeActivity;</code></pre>
  </div>
  </div>
  </p>
  
  <p>ProfileActivity.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import React, {Component} from 'react';
  import { StyleSheet, Text, View, Button} from 'react-native';
  class ProfileActivity extends Component {
    static navigationOptions = {
      title: 'Profile',
      headerStyle: {backgroundColor: '#73C6B6'},
    };
    render() {
      return (
        &lt;View style={styles.container}&gt;
          &lt;Text style={styles.headerText}&gt;Profile Activity&lt;/Text&gt;
          &lt;Button
            title="Go to Home"
            onPress={() =&gt; this.props.navigation.navigate('Home')}
          /&gt;
          &lt;Text style={styles.headerText}&gt;Create a New Profile Screen &lt;/Text&gt;
          &lt;Button
            title="Go to new Profile"
            onPress={() =&gt; this.props.navigation.push('Profile')}
          /&gt;
          &lt;Text style={styles.headerText}&gt; Go Back &lt;/Text&gt;
          &lt;Button
            title="Go Back"
            onPress={() =&gt; this.props.navigation.goBack()}
          /&gt;
        &lt;/View&gt;
      );
    }
  }
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center',
      backgroundColor: '#F5FCFF',
    },
    headerText: {
      fontSize: 20,
      textAlign: 'center',
      margin: 10,
      fontWeight: 'bold',
    },
  });
  export default ProfileActivity;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> "dependencies": {
      "@react-native-community/masked-view": "^0.1.7",
      "@react-navigation/native": "^5.1.4",
      "react": "16.11.0",
      "react-native": "0.62.0",
      "react-native-gesture-handler": "^1.6.1",
      "react-native-paper": "2.1.3",
      "react-native-reanimated": "^1.7.1",
      "react-native-safe-area-context": "^0.7.3",
      "react-native-screens": "^2.4.0",
      "react-navigation": "2.6.2"
    }</code></pre>
  </div>
  </div>
  </p>