Search code examples
iosreactjsgoogle-mapsreact-nativereact-native-maps

react-native-maps: AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS


I'm trying to use google maps on iOS and I get this error:

react-native-maps: AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS.

Error Image

I'm using react-native.maps https://github.com/react-community/react-native-maps

I followed the install instructions, in Android it worked perfectly but it doesn't in IOS

macOS: 10.14.1 (18B75)

dependencies {

"react": "16.5.0",

"react-native": "0.57.1",

"react-native-maps": "^0.22.1",

}

Solution

  • ok I just had the same problem, so here is how i fixed it:

    First follow this answer here:

    https://github.com/react-community/react-native-maps/issues/693#issuecomment-262656417

    Then you would need to go inside xcode > build settings > Preprocessor Macros > add HAVE_GOOGLE_MAPS=1

    P.S inside actual component i used

    import MapView from "react-native-maps";
    
    <MapView provider={MapView.PROVIDER_GOOGLE} style={styles.map} />
    

    my styles > map: { position: "absolute", top: 0, left: 0, bottom: 0, right: 0 }

    Hope this helps ;)