title: Cannot read property 'animateMarkerToCoordinate' of undefined
body: <pre><code>import React from 'react';
  import { StyleSheet, View, Dimensions, Platform, SafeAreaView } from 'react-native';
  import MapView, { Marker, AnimatedRegion } from 'react-native-maps';
  import PubNubReact from 'pubnub-react';
  
  const { width, height } = Dimensions.get('window');
  
  const ASPECT_RATIO = width / height;
  const LATITUDE = 37.78825;
  const LONGITUDE = -122.4324;
  const LATITUDE_DELTA = 0.0922;
  const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO;
  
  console.disableYellowBox = true;
  
  class App extends React.Component {
    constructor(props) {
      super(props);
  
      this.state = {
        latitude: LATITUDE,
        longitude: LONGITUDE,
        coordinate: new AnimatedRegion({
          latitude: null,
          longitude: null,
          latitudeDelta: LATITUDE_DELTA,
          longitudeDelta: LONGITUDE_DELTA,
        }),
      };
  
      // Replace &quot;X&quot; with your PubNub Keys
      this.pubnub = new PubNubReact({
        publishKey: 'X',
        subscribeKey: 'X',
      });
      this.pubnub.init(this);
    }
  
    // code to receive messages sent in a channel
    componentDidMount() {
      this.subscribeToPubNub();
    }
  
    subscribeToPubNub = () =&gt; {
      this.pubnub.subscribe({
        channels: ['location'],
        withPresence: true,
      });
      this.pubnub.getMessage('location', msg =&gt; {
        const { coordinate } = this.state;
        const { latitude, longitude } = msg.message;
        const newCoordinate = { latitude, longitude };
  
        if (Platform.OS === 'android') {
          if (this.marker) {
            this.marker._component.animateMarkerToCoordinate(newCoordinate, 500);
          }
        } else {
          coordinate.timing(newCoordinate).start();
        }
  
        this.setState({
          latitude,
          longitude,
        });
      });
    };
  
    getMapRegion = () =&gt; ({
      latitude: this.state.latitude,
      longitude: this.state.longitude,
      latitudeDelta: LATITUDE_DELTA,
      longitudeDelta: LONGITUDE_DELTA,
    });
  
    render() {
      return (
        &lt;SafeAreaView style={{ flex: 1 }}&gt;
          &lt;View style={styles.container}&gt;
            &lt;MapView
              style={styles.map}
              showUserLocation
              followUserLocation
              loadingEnabled
              ref={c =&gt; (this.mapView = c)}
              region={this.state.latitude ? this.getMapRegion() : null}
            &gt;
              &lt;Marker.Animated
                ref={marker =&gt; {
                  this.marker = marker;
                }}
                coordinate={this.state.coordinate}
              /&gt;
            &lt;/MapView&gt;
          &lt;/View&gt;
        &lt;/SafeAreaView&gt;
      );
    }
  }
  
  const styles = StyleSheet.create({
    container: {
      ...StyleSheet.absoluteFillObject,
      justifyContent: 'flex-end',
      alignItems: 'center',
    },
    map: {
      ...StyleSheet.absoluteFillObject,
    },
  });
  
  export default App;
  </code></pre>
  <p>I am getting error of <strong>&quot;Cannot read property 'animateMarkerToCoordinate' of undefined&quot;</strong>
  in my React Native code. I am developing location tracking app on android. Which extracts LAT and LONG from another app and is want animate is on Google map. I read on some other sites that animateMarkerToCoordinate does not work in React Native for Android. Is it true? and If not what is the solution for this issue?</p>