Expo standalone app crashes on map view

I have a big issue with an app that i’m trying to pusblish on prod. Everything is ok in dev envirement, but when i’m creating a standalone apk and test the app, it crashes when i’m trying to open a view which have expo map view on it. The app just restart when i’m trying to get this view.

Here is the code :

<MapView
ref={map => this.mapRef = map}
onLayout={() => this.mapRef.fitToElements(true)}
style={{ flex: 1, height: 200 }}
initialRegion={{
latitude: get(company, “locations.0.latitude”),
longitude: get(company, “locations.0.longitude”),
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
>
{locations.map(location => (
<MapView.Marker
coordinate={{latitude: location.latitude, longitude: location.longitude}}
title={location.name}
description={location[“full_address”]}
/>
))}

Hey @masamasan,

Can you make sure you’ve generated your own Google Maps API key and have added it to your app.json for whichever platforms you’re using it on?

https://docs.expo.io/versions/v34.0.0/workflow/configuration/#ios
https://docs.expo.io/versions/v34.0.0/workflow/configuration/#android

Cheers,
Adam

1 Like

Thank you for your answer, i made it. I have no crash anymore but on ios the map doesn’t display well, only have the ocean and nothing else. Maps SDK for Ios is active on Api side.

Happy to help! Glad you got things trending in the right direction. You’ll likely want to dive into the maps repo https://github.com/react-native-community/react-native-maps to try and create the most fluid user experience possible with the MapView.