Referenced assets appear in Expo dev build but not prod build
I have a Rive file in a React Native Expo project that is structured as follows:
<Rive
source={require('../assets/rive/GoldfinchReferenced.riv')}
style=<style>
autoplay
artboardName={ARTBOARD}
stateMachineName={STATE_MACHINE}
ref={riveRef}
onStateChanged={handleStateChanged}
referencedAssets={{
'Hat01-4547939': {
source: require('../assets/referenced/Goldfinch/Hat01-4547939.webp'),
},
'Hat02-4547999': {
source: require('../assets/referenced/Goldfinch/Hat02-4547999.webp'),
},
// And so on
/>
The referenced assets appear successfully in my Expo development build (the build that comes from running ‘npx eas build --profile development’). But when I create a production build (from running ‘npx eas build --profile preview’), the assets do not show in the Rive anymore. I’m curious why this is the case?
I’ve played around with using ‘resourceName’ instead of ‘source’ in the Rive object, but the issue was still present. I’m not sure what else to do at this point, so reaching out here!