react-native-maps: Android : Error while updating property 'region' of a view managed by : AIRMap

While everything works fine on iOS, I get this error when running on Android :

screenshot_2016-03-16-14-09-48

My MapView component :

<MapView
            ref='map view'
            rotateEnabled={false}
            style={styles.restaurantsMap}
            showsUserLocation={this.state.showsUserLocation}
            region={this.state.region}
            onRegionChangeComplete={this.onRegionChangeComplete}
            onRegionChange={this.onRegionChange}>
            <MapView.Circle
              center={center}
              radius={this.state.radius}
              fillColor='rgba(0, 0, 0, 0.1)'
              strokeColor='#FE3139' />
          </MapView>

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 13
  • Comments: 28 (4 by maintainers)

Most upvoted comments

In my case, my issue was that the latitude and longitude props passed to MapView were typeof string. Fixed doing a parseFloat before.

While everything works fine on iOS, I get this error when running on Android :

screenshot_2016-03-16-14-09-48

I had the same error using yarn add react-native-maps to display a MapView component

Using expo install react-native-maps fixed things!

Ok, I figured it out what was my problem in this case:

If you use showsUserLocation props you need to add the ACCESS_FINE_LOCATION permission into your AndroidManifest.xml. Which make sense 😜

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

That worked for me

Screenshot_1667474266

While everything works fine on iOS, I get this error when running on Android previous it working but now not working

I was having the same issue! Debbuging the component I realized that region needs latitudDelta and longitudDelta. Once you add those props everything will work just fine… At least that worked for me.

While everything works fine on iOS, I get this error when running on Android : screenshot_2016-03-16-14-09-48

I had the same error using yarn add react-native-maps to display a MapView component

Using expo install react-native-maps fixed things!

you have saved my day

While everything works fine on iOS, I get this error when running on Android : screenshot_2016-03-16-14-09-48

I had the same error using yarn add react-native-maps to display a MapView component

Using expo install react-native-maps fixed things!

This fixed it for me! Thanks a lot!

In my case latitude and longitude were missing from camera.center:

<MapView
  ...
  camera={{
    center: {
      latitude: parseFloat(latitude),
      longitude: parseFloat(longitude),
    },
    ...
  }}>

I’m having the same issue, I added the deltas coordinates but I still get this error:

            <MapView
              region={{
                latitude: 52.3015493,
                longitude: 4.6939769,
                latitudeDelta: 3,
                longitudeDelta: 4,
              }}
              style={styles.map}
              showsUserLocation
              zoomEnabled={false}
              scrollEnabled={false}
              rotateEnabled={false}
            >
              <MapView.Marker
                coordinate={{latitude:52.3015493,
                  longitude:4.6939769}} />
            </MapView>

@logan0900 found a temporary fix change googlePlayServicesVersion = β€œ+” to googlePlayServicesVersion = β€œ17.0.0” in android/build.gradle. Working for me

image