Question: I have a custom object in a Map: below is the structure

```
Allocation {
double risk;
double[] weights;
double returnValue;
}

```

I have a Map of Allocation Objects such as:

```
Map<String, Allocation>

```

I would like to get the weights in a 2d array with Java 8. 

weights={{.3, .2, 0.5}, {0.4, 0.4,0.2}, {0.5, 0.25, 0.25},...}

The Allocation Map contains many Portfolio objects like below:

```
key: portfolio1, Object: (risk=0.03, weights={0.3,0.2,0.5}, returnvalue=0.5)
Key: portfolio2, Object: (risk=0.05, weights={0.4,0.4,0.2}, returnvalue=0.3)
Key: portfolio3, Object: (risk=0.01, weights={0.5, 0.25, 0.25}, return=0.6)

```

I would like to get an 2d array of weights:

```
weights[0] = {0.3,0.2,0.5}
weights[1] = {0.4,0.4,0.2}
weights[1] = {0.5, 0.25, 0.25} and so on...

```

Looking for the best way to do so
Thanks!

Answer: 
this issue came arise in react native `0.63.+` version. As per the official documentation of `react-native-maps`

```
 const duration = 500

  if (this.props.coordinate !== nextProps.coordinate) {
    if (Platform.OS === 'android') {
      if (this.marker) {
        this.marker._component.animateMarkerToCoordinate(
          nextProps.coordinate,
          duration
        );
      }
    } else {
      this.state.coordinate.timing({
        ...nextProps.coordinate,
        duration
      }).start();
    }
  } 

```

but this is not working with latest react-native version. just remove `_component` before `animateMarkerToCoordinate` it will work fine.

```
 const duration = 500

  if (this.props.coordinate !== nextProps.coordinate) {
    if (Platform.OS === 'android') {
      if (this.marker) {
        this.marker.animateMarkerToCoordinate(
          nextProps.coordinate,
          duration
        );
      }
    } else {
      this.state.coordinate.timing({
        ...nextProps.coordinate,
        duration
      }).start();
    }
  }

```
Use try catch. It will not crash

```
          if (this.marker && this.mounted) {

          setTimeout(() => {
            try {
              this.marker.animateMarkerToCoordinate(
                coordinate,
                duration
              )

          } catch (error) {
            console.log(error)
          }

        }, 100);
        // this.marker._component.animateMarkerToCoordinate(
        //   coordinate,
        //   duration
        // );
      }

```