React-Native static images not loading in iOS - Xcode 12



Static images are not loading in React-Native iOS Application when working with React-Native version 0.60 and above and Xcode 12. This is because of some changes in Image component of React-Native latest version.


To resolve the issue of React-Native image not loading please follow the below steps - 

  • Copy and paste below code to the end of your Podfile - 

pre_install do |installer|
puts("Image fix for ios14: remove this when upgradeing to >= 0.63.3")
find = "_currentFrame.CGImage;"
replace = "_currentFrame.CGImage ;} else { [super displayLayer:layer];"
op = `sed -ie "s/#{find}/#{replace}/"
    ../node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m`
puts("Image fix for ios14 done")
end


  • Go to the project directory and run below commands -

     cd ios && pod install

  • Run your application and you will see it's working. 



Comments

  1. Extremely useful information which you have shared here about React Native development. This is a great way to enhance knowledge for us, and also beneficial for us. Thank you for sharing a post like this. React native development company USA

    ReplyDelete
  2. There are a few things to keep in mind when using an Travel eSIM Card. First, you will need to make sure that your phone is compatible with the eSIM technology. Second, you will need to find a carrier that offers international eSIM service. And finally, you will need to activate the eSIM on your phone.

    ReplyDelete

Post a Comment