skip to Main Content

I always get this error ERROR Warning: TypeError: Cannot read property 'bubblingEventTypes' of null when I add provider: {PROVIDER_GOOGLE} on my MapView

Here is my code, I use gluestack-ui as UI library that is why I’m using Box as View:

<Box className='flex-1 h-full bg-gray-500'>
  <MapView
    style={StyleSheet.absoluteFillObject}
    provider={PROVIDER_GOOGLE}
  />
</Box>

I also tried:

<View style={StyleSheet.absoluteFillObject}>
  <MapView
    style={StyleSheet.absoluteFillObject}
    provider={PROVIDER_GOOGLE}
  />
</View>

Here are the reference link that I followed: expo mapview and installation guide.

The image below is the error:

enter image description here

THANK YOU FOR YOUR HELP!!!

2

Answers


  1. Yes, you are using the expo go that is why you are facing the issue, You need to define the app.json. and make the development build not the expo go using the expo-dev-client

    "ios": {
      "config": {
        "googleMapsApiKey": "API-key"
    }
    

    and for the Android

    "android": {
      "config": {
        "googleMaps": {
            "apiKey": "API-key "
        }
      }
    }
    
    Login or Signup to reply.
  2. This is a bug in Expo Go! Because according to Expo documentation: https://docs.expo.dev/versions/latest/sdk/map-view/, MapView component is packaged with Expo Go. They have actualy highlighted that paragraph! I am about to report this as a bug.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search