skip to Main Content

I have used several icons in the application, but they are not loading in iOS build, but load perfectly fine in Android build. The icons been used are PNG files in local assets folder. I have tried to use different methods to include Image files;

  1. var chevron_right = require('./chevron-right.png');
  2. import chevron_right from './chevron-right.png';
  3. Third that I used was to put a JS file (i.e. Icons.js) in the folder where there the images are and than export those images from it. Like: export default { chevron_right : require('./chevron-right.png') } and then import where I want Like: import Icons from './path/to/icons' <Image source={Icons.chevron_right} style={{ height: 8, width: 8 }} />

All of the above three methods do not work for iOS builds. The screenshots are attached, the versions of expo and react native are:
Expo CLI: 0.60,
Expo SDK: 46,
React: 18,
React Native: 0.69.4

Screenshots:

iOS Screenshot

Android Screen Shot

2

Answers


  1. Chosen as BEST ANSWER

    I updated my EAS CLI from 0.60 to 1.1.1, now my Images are rendering in iOS build.


  2. The error seems to be with the Xcode. So pls Follow this
    React-native iOS not showing images (pods issue). Read the full thread.

    The question is answered.(Regards)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search