Reputation: 186
Using react-native v0.63.4, and all the local image load fine in development mode
<Image
source={require('../assets/images/xyz.png')}
style={styles.img}
resizeMode="cover"
/>
but once we built it in release mode or test flight, all the image loaded with require
is not being rendered.
What I have found so far:
Thanks in advance!
Upvotes: 6
Views: 1372
Reputation: 1524
This can be linking issue
In Build Phases > Bundle React Native code and images replace any lines you have for this:
export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh
After that clean project, delete build folder and run following command
react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
I hope this is helpful.
Also make sure your asset folder is there in Build Phases > Copy Bundle Resources.
Upvotes: 1