React native custom map marker issue in iOS release config

Viewed 238

I'm trying to get a react native app that's already working nicely on android to run on iOS. It uses react-native-maps to display a map view, and custom markers on it. When running the app in debug config, the markers look the way should, like below.

enter image description here

But when I run it in release config or send it to testflight, marker icons go haywire, and looks like this.

enter image description here

The implementation is as follows (trimmed the code down to essential parts so it may have missing variables etc...)

import MapView, { Marker } from 'react-native-maps';
 
const marker = require('../assets/marker.png');
const markerDark = require('../assets/marker-dark.png');
const customMapStyle = require('../assets/customMapStyle.json');

export default function DisplayMapView () => {
  return (
    <MapView {...mapProperties} ref={mapRef} style={mapStyle} onPress={onMapPress}>
      <For each="markerData" of={markerDatas || []}>
        <Marker
          showsTraffic={false}
          showsCompass={false}
          mapType={'terrain'}
          {...markerData}
        >
          <Text>
            {markerData.label}
          </Text>
          <Image
            resizeMethod="resize"
            resizeMode="center"
            style={styles.marker}
            source={shouldDarkMarker(markerData) ? markerDark : marker}
          />
        </Marker>
      </For>
    </MapView>
  );
}

How can I get the custom markers working in release config?

0 Answers
Related