Image map wrongly in release build for React Native app

I’m using require(./image/xx.png) to pass in the <Image> source. It appears to happen on Android release build only.

The images are showing up but they are wrongly map all over the screen [refer:image]. It occurs whenever user installed new update over the old version.

If user uninstall and reinstall, then the app appears fine. But I couldn’t force user to uninstall and reinstall each time new update is released to store.

"react-native": "0.66.1",

Example usage:

const IMG_LOGO = require('../../../assets/image/logo.png')

<Image source={IMG_LOGO} style={styles.imgLogo} resizeMode='contain'/>

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Fixed by downgrading fresco version from 2.6.0 to 2.5.0

implementation 'com.facebook.fresco:animated-gif:2.5.0'

Solution from
https://github.com/facebook/react-native/issues/32671

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply