MapView with provider="google" throws error on iOS build

#1

MapView works fine in Expo, but when I detach and run via xcode I get an error:
libc++abi.dylib: terminating with uncaught exception of type NSException

This only happens when using provider=google.

To reproduce:

          <MapView
              style={{ flex: 1,  alignSelf: 'stretch'}}
              initialRegion={{
                  latitude: 37.78825,
                  longitude: -122.4324,
                  latitudeDelta: 0.0922,
                  longitudeDelta: 0.0421,
              }}
              provider={MapView.PROVIDER_GOOGLE}
          />
#!/usr/bin/env bash
create-react-native-app test-mapview-ios-eject
npm run eject
cd ios
pod install
open test-mapview-ios-eject.xcworkspace
# build in xcode

# error:
# ios/test-mapview-ios-eject/Supporting/main.m
# libc++abi.dylib: terminating with uncaught exception of type NSException

Do I need to configure MapView for Google when ejecting?

The docs do not mention any special config is needed.

I thought that Expo modules worked identically in ExpoKit when you are ejected?

0 Likes

closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

0 Likes

#3

Sorry for the extremely late reply here. We were missing some documentation about how to provide your own API key when using the Google provider for MapView. I’ve made a change to our docs which should clarify this.

0 Likes